|
|
@ -143,11 +143,13 @@ class Task: |
|
|
|
self.__thread.start() |
|
|
|
self.__thread.start() |
|
|
|
|
|
|
|
|
|
|
|
def __run(self): |
|
|
|
def __run(self): |
|
|
|
self.run() |
|
|
|
try: |
|
|
|
print('Task ' + self.task_id + ' has finished') |
|
|
|
self.run() |
|
|
|
self.__finished_at = datetime.now() |
|
|
|
print('Task ' + self.task_id + ' has finished') |
|
|
|
Task.__free_resources(self) |
|
|
|
self.__finished_at = datetime.now() |
|
|
|
Task.__update_pending_tasks() |
|
|
|
finally: |
|
|
|
|
|
|
|
Task.__free_resources(self) |
|
|
|
|
|
|
|
Task.__update_pending_tasks() |
|
|
|
|
|
|
|
|
|
|
|
@staticmethod |
|
|
|
@staticmethod |
|
|
|
def get(task_id): |
|
|
|
def get(task_id): |
|
|
|