|
@@ -574,8 +574,9 @@ class RandomIntVal():
|
|
|
self.value = randint(0, 100000)
|
|
|
|
|
|
class AsyncJob(pj.PendingJob):
|
|
|
- def __init__(self, app):
|
|
|
+ def __init__(self, ep, app):
|
|
|
super().__init__()
|
|
|
+ self.ep = ep
|
|
|
self.app = app
|
|
|
self.logger = app.logger
|
|
|
self.val = RandomIntVal()
|
|
@@ -587,6 +588,10 @@ class AsyncJob(pj.PendingJob):
|
|
|
def __del__(self):
|
|
|
self.logger.warn("Job deleted id:%s, value:%s", id(self), self.val.value)
|
|
|
|
|
|
+ job = AsyncJob(self.ep, self.app)
|
|
|
+ self.logger.warn("Adding job 1")
|
|
|
+ self.ep.utilAddPendingJob(job)
|
|
|
+
|
|
|
@singleton_keys
|
|
|
class BotAgent:
|
|
|
|
|
@@ -615,7 +620,7 @@ class BotAgent:
|
|
|
|
|
|
def _add_new_job(self):
|
|
|
self.logger.warn("Creating job 1")
|
|
|
- job = AsyncJob(self.app)
|
|
|
+ job = AsyncJob(self.ep, self.app)
|
|
|
self.logger.warn("Adding job 1")
|
|
|
self.ep.utilAddPendingJob(job)
|
|
|
|