def delete(self, actor_id): logger.debug("top of DELETE /actors/{}".format(actor_id)) id = Actor.get_dbid(g.tenant, actor_id) logger.info("calling shutdown_workers() for actor: {}".format(id)) shutdown_workers(id) logger.debug("shutdown_workers() done") try: actor = Actor.from_db(actors_store[id]) executions = actor.get('executions') or {} for ex_id, val in executions.items(): del logs_store[ex_id] except KeyError as e: logger.info("got KeyError {} trying to retrieve actor or executions with id {}".format( e, id)) # delete the actor's message channel # TODO - needs work; each worker is subscribed to the ActorMsgChannel. If the workers are not # closed before the ch.delete() below, the ActorMsgChannel will survive. try: ch = ActorMsgChannel(actor_id=id) ch.delete() logger.info("Deleted actor message channel for actor: {}".format(id)) except Exception as e: # if we get an error trying to remove the inbox, log it but keep going logger.error("Unable to delete the actor's message channel for actor: {}, exception: {}".format(id, e)) del actors_store[id] logger.info("actor {} deleted from store.".format(id)) del permissions_store[id] logger.info("actor {} permissions deleted from store.".format(id)) del nonce_store[id] logger.info("actor {} nonnces delete from nonce store.".format(id)) return ok(result=None, msg='Actor deleted successfully.')
def delete(self, actor_id): id = Actor.get_dbid(g.tenant, actor_id) shutdown_workers(id) try: actor = Actor.from_db(actors_store[id]) executions = actor.get('executions') or {} for ex_id, val in executions.items(): del logs_store[ex_id] except KeyError: print("Did not find actor with id: {}".format(id)) del actors_store[id] del permissions_store[id] return ok(result=None, msg='Actor deleted successfully.')
def delete(self, actor_id): logger.debug("top of DELETE /actors/{}".format(actor_id)) id = Actor.get_dbid(g.tenant, actor_id) logger.info("calling shutdown_workers() for actor: {}".format(id)) shutdown_workers(id) logger.debug("shutdown_workers() done") try: actor = Actor.from_db(actors_store[id]) executions = actor.get('executions') or {} for ex_id, val in executions.items(): del logs_store[ex_id] except KeyError as e: logger.info("got KeyError {} trying to retrieve actor or executions with id {}".format( e, id)) del actors_store[id] logger.info("actor {} deleted from store.".format(id)) del permissions_store[id] logger.info("actor {} permissions deleted from store.".format(id)) return ok(result=None, msg='Actor deleted successfully.')
def delete(self, actor_id): shutdown_workers(actor_id) del actors_store[actor_id] return ok(result=None, msg='Actor delete successfully.')