Skip to content

Commit

Permalink
Fix line too long in comment
Browse files Browse the repository at this point in the history
  • Loading branch information
roulaoregan-spi committed Jul 20, 2021
1 parent 3d611a0 commit 1150174
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
2 changes: 1 addition & 1 deletion cuegui/cuegui/JobMonitorTree.py
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ def getJobProxies(self):
"""
jobIdsTimeLoaded = []

for jobProxy in self._items.keys():
for jobProxy, _ in self._items.items():
try:
jobIdsTimeLoaded.append((jobProxy, self.__jobTimeLoaded[jobProxy]))
except KeyError:
Expand Down
18 changes: 10 additions & 8 deletions cuegui/cuegui/plugins/MonitorJobsPlugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,15 +112,17 @@ def restoreJobIds(self, jobIds):
Only load jobs that have a timestamp less than or equal to the time a job lives on the farm
(jobs are moved to historical database)
:param jobIds: monitored jobs ids and their timestamp from previous working state (loaded from config.ini file)
:ptype: list of tuples (ex: [("Job.f156be87-987a-48b9-b9da-774cd58674a3", 1612482716.170947),...
:param jobIds: monitored jobs ids and their timestamp from previous working state
(loaded from config.ini file)
:ptype: list of tuples ex:
[("Job.f156be87-987a-48b9-b9da-774cd58674a3", 1612482716.170947),...
"""
today = datetime.datetime.now()
limit = JOB_LOAD_LIMIT if len(jobIds) > JOB_LOAD_LIMIT else len(jobIds)
msg = """
Unable to load previously loaded job since
it was moved to the historical
database: {0}
database:
"""

try:
Expand All @@ -129,15 +131,15 @@ def restoreJobIds(self, jobIds):
if (today - loggedTime).days <= TIME_DELTA:
try:
self.jobMonitor.addJob(jobId, timestamp)
except opencue.EntityNotFoundException as e:
logger.info(msg.format(jobId))
except ValueError as e:
except opencue.EntityNotFoundException:
logger.info(msg, jobId)
except ValueError:
# load older format
for jobId in jobIds[:limit]:
try:
self.jobMonitor.addJob(jobId)
except opencue.EntityNotFoundException as e:
logger.info(msg.format(jobId))
except opencue.EntityNotFoundException:
logger.info(msg, jobId)

def pluginRestoreState(self, saved_settings):
"""Called on plugin start with any previously saved state.
Expand Down

0 comments on commit 1150174

Please sign in to comment.