1
0
mirror of https://github.com/dkmstr/openuds.git synced 2024-12-22 13:34:04 +03:00

Merge remote-tracking branch 'origin/v1.9'

This commit is contained in:
Adolfo Gómez García 2015-10-05 11:48:22 +02:00
commit 69b6f7d7d8

View File

@ -33,7 +33,7 @@
from __future__ import unicode_literals
from django.db.models import Q
from django.db import transaction, DatabaseError
from django.db import transaction, DatabaseError, connection
from uds.models import Scheduler as dbScheduler, getSqlDatetime
from uds.core.util.State import State
from uds.core.jobs.JobsFactory import JobsFactory
@ -43,7 +43,7 @@ import threading
import time
import logging
__updated__ = '2015-04-15'
__updated__ = '2015-10-05'
logger = logging.getLogger(__name__)
@ -82,6 +82,9 @@ class JobThread(threading.Thread):
logger.info('Database access locked... Retrying')
time.sleep(1)
# Ensures DB connection is released after job is done
connection.close()
def __updateDb(self):
'''
Atomically updates the scheduler db to "release" this job