@@ -1510,7 +1510,7 @@ def setJobCommandStatus(self, jobID, command, status):
15101510 return self ._update (f"UPDATE JobCommands SET Status={ status } WHERE JobID={ jobID } AND Command={ command } " )
15111511
15121512 #####################################################################################
1513- def fillJobsHistorySummary (self ):
1513+ def fillJobsHistorySummary (self , fill_time : str ):
15141514 """Fill the JobsHistorySummary table with the summary of the jobs in a final state"""
15151515
15161516 # Create the staging table
@@ -1525,7 +1525,7 @@ def fillJobsHistorySummary(self):
15251525 final_states = f"'{ final_states } '"
15261526 query = (
15271527 f"INSERT INTO JobsHistorySummary_staging SELECT { defString } , { valuesString } "
1528- f"FROM Jobs WHERE Status IN ({ final_states } ) AND LastUpdateTime < UTC_DATE() "
1528+ f"FROM Jobs WHERE Status IN ({ final_states } ) AND LastUpdateTime < ' { fill_time } ' "
15291529 f"GROUP BY { defString } "
15301530 )
15311531 if not (result := self ._update (query ))["OK" ]:
@@ -1539,7 +1539,7 @@ def fillJobsHistorySummary(self):
15391539 )
15401540 return self ._update (sql )
15411541
1542- def getSummarySnapshot (self , requestedFields = False ):
1542+ def getSummarySnapshot (self , fill_time : str , requestedFields = False ):
15431543 """Get the summary snapshot for a given combination"""
15441544 if not requestedFields :
15451545 requestedFields = ["Status" , "MinorStatus" , "Site" , "Owner" , "OwnerGroup" , "JobGroup" ]
@@ -1555,10 +1555,10 @@ def getSummarySnapshot(self, requestedFields=False):
15551555 f"GROUP BY { defString } "
15561556 )
15571557 query += "UNION ALL "
1558- # Recent jobs only (today ) that are in a final state
1558+ # Recent jobs only (after fill_time ) that are in a final state
15591559 query += (
15601560 f"SELECT { defString } , COUNT(JobID) AS JobCount, SUM(RescheduleCounter) AS RescheduleSum "
1561- f"FROM Jobs WHERE Status IN ({ final_states } ) AND LastUpdateTime >= UTC_DATE() "
1561+ f"FROM Jobs WHERE Status IN ({ final_states } ) AND LastUpdateTime >= ' { fill_time } ' "
15621562 f"GROUP BY { defString } "
15631563 )
15641564 query += "UNION ALL "
0 commit comments