diff options
-rw-r--r-- | prolog/engine.py | 15 |
1 files changed, 2 insertions, 13 deletions
diff --git a/prolog/engine.py b/prolog/engine.py index ef54833..11185b0 100644 --- a/prolog/engine.py +++ b/prolog/engine.py @@ -27,16 +27,6 @@ def create(code='', query='', timeout=10): reply = reply['answer']['data'] return reply, output -def abort(engine): - params = urllib.parse.urlencode({ - 'id': engine, - 'format': 'json-html'}) - try: - # We don't care about the answer here, so don't wait for it. - request('GET', '/pengine/abort?' + params, timeout=0.01) - except: - pass - def ask(engine, query, timeout=10): return send(engine, 'ask(({}),[])'.format(query), timeout=timeout) @@ -47,9 +37,9 @@ def stop(engine, timeout=10): return send(engine, 'stop', timeout=timeout) def destroy(engine): + params = urllib.parse.urlencode({'ids': engine}) try: - # We don't care about the answer here, so don't wait for it. - send(engine, 'destroy([force(true)])', timeout=0.01) + request('GET', '/pengine/destroy_all?' + params, timeout=0.01) except: pass @@ -196,7 +186,6 @@ def run(code, query, timeout): messages.append(error) except socket.timeout as ex: result.append('timed out') - abort(engine) finally: if engine: destroy(engine) |