Skip to content

Commit

Permalink
fix #7990 (#7991)
Browse files Browse the repository at this point in the history
* fix #7990

* also improve msg look

* pep8
  • Loading branch information
belforte authored Nov 1, 2023
1 parent 8d6330b commit 9cb5d51
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/python/TaskWorker/Actions/Recurring/TapeRecallManager.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ def handleRecall(self):
msg = f"Working on task {taskName}"
self.logger.info(msg)
# 1.) check for "waited too long"
waitDays = (time.time() - getTimeFromTaskname(str(taskName))) // 3600 // 24 # from sec to days
waitDays = int((time.time() - getTimeFromTaskname(str(taskName))) // 3600 // 24) # from sec to days
if waitDays > MAX_DAYS_FOR_TAPERECALL:
msg = f"Tape recall request did not complete in {MAX_DAYS_FOR_TAPERECALL} days."
self.logger.info(msg)
Expand Down Expand Up @@ -136,11 +136,11 @@ def handleRecall(self):
okFraction = ok * 100 // total
msg = f"Data recall from tape in progress: ok/all = {ok}/{total} = {okFraction}%"
msg += f"\nRucio rule details at https://cms-rucio-webui.cern.ch/rule?rule_id={reqId}"
enoughData = okFraction > 99 or (rule['name'].endswith('SIM') and okFraction > 90 )
enoughData = okFraction > 99 or (rule['name'].endswith('SIM') and okFraction > 90)
if waitDays > 7 and enoughData:
mag += (f"This recall has lasted {waitDays} already and it is > {okFraction}% complete")
msg += ("Your needs are very likely to be satisfied with what's on disk now")
msg += ("Suggestion: kill this task and submit another one with config.Data.partialDataset=True")
msg += (f"\nThis recall has lasted {waitDays} days already and it is > {okFraction}% complete")
msg += ("\nYour needs are very likely to be satisfied with what's on disk now")
msg += ("\nSuggestion: kill this task and submit another one with config.Data.partialDataset=True")
self.deleteWarnings(taskName)
self.uploadWarning(taskname=taskName, msg=msg)
self.logger.info("Done on this task")
Expand Down

0 comments on commit 9cb5d51

Please sign in to comment.