Skip to content

Commit

Permalink
db_sql: _update - fix kill timeout
Browse files Browse the repository at this point in the history
Fetch from config
  • Loading branch information
aoblet committed Dec 6, 2022
1 parent 8f7450e commit eb4ea05
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion db_sql.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# -*- coding: utf-8 -*-

import unittest, time, re, sys
from db import DB
from importlib import import_module
Expand Down Expand Up @@ -939,6 +940,7 @@ def pickJob (self, hostname, cpu, free_memory, total_memory, ip):
# The former case is EXPECTED, but not the latter one
# Therefore, we need to add a query that take the first Job that has no affinity WHEN Workers are not doing anything
if job is None:

self._execute(cur, dedent("""
SELECT id, title, command, dir, user, environment
FROM Jobs
Expand Down Expand Up @@ -1197,7 +1199,7 @@ def _update (self):
self.LastUpdate = current_time
self.RunTime = 0
cur = self.Conn.cursor ()
timeout = 60
timeout = self.config.get("sleep", 2) * 2

# find all working jobs that are running out of time *or*
# all working jobs which worker is timing out
Expand Down

0 comments on commit eb4ea05

Please sign in to comment.