This commit is contained in:
@@ -11,7 +11,7 @@ log=logging.getLogger(__name__)
|
||||
def cleanup(batch=100):
|
||||
now=time.time(); removed=0
|
||||
with sessions().begin() as db:
|
||||
q=select(Job).where(Job.expires_at<=now, or_(Job.status!='processing', Job.lease_until<now)).limit(batch)
|
||||
q=select(Job).where(Job.expires_at != -1, Job.expires_at<=now, or_(Job.status!='processing', Job.lease_until<now)).limit(batch)
|
||||
if engine().dialect.name=='postgresql': q=q.with_for_update(skip_locked=True)
|
||||
for job in db.scalars(q):
|
||||
try:
|
||||
|
||||
مرجع در شماره جدید
مسدود کردن کاربر