mirror of
https://github.com/dkmstr/openuds.git
synced 2025-01-08 21:18:00 +03:00
This commit is contained in:
parent
af9bfccf65
commit
1b03851ace
@ -53,13 +53,13 @@ class JobThread(threading.Thread):
|
|||||||
self._jobInstance.execute()
|
self._jobInstance.execute()
|
||||||
except Exception:
|
except Exception:
|
||||||
logger.debug("Exception executing job {0}".format(self._dbJobId))
|
logger.debug("Exception executing job {0}".format(self._dbJobId))
|
||||||
self.save()
|
self.jobDone()
|
||||||
|
|
||||||
def save(self):
|
def jobDone(self):
|
||||||
done = False
|
done = False
|
||||||
while done is False:
|
while done is False:
|
||||||
try:
|
try:
|
||||||
self.__save()
|
self.__updateDb()
|
||||||
done = True
|
done = True
|
||||||
except:
|
except:
|
||||||
# Erased from database, nothing hapens
|
# Erased from database, nothing hapens
|
||||||
@ -69,7 +69,7 @@ class JobThread(threading.Thread):
|
|||||||
|
|
||||||
|
|
||||||
@transaction.commit_on_success
|
@transaction.commit_on_success
|
||||||
def __save(self):
|
def __updateDb(self):
|
||||||
job = dbScheduler.objects.select_for_update().get(id=self._dbJobId)
|
job = dbScheduler.objects.select_for_update().get(id=self._dbJobId)
|
||||||
job.state = State.FOR_EXECUTE
|
job.state = State.FOR_EXECUTE
|
||||||
job.owner_server = ''
|
job.owner_server = ''
|
||||||
|
Loading…
Reference in New Issue
Block a user