File tree Expand file tree Collapse file tree 1 file changed +4
-0
lines changed
CondCore/Utilities/scripts Expand file tree Collapse file tree 1 file changed +4
-0
lines changed Original file line number Diff line number Diff line change @@ -780,7 +780,11 @@ class timestamp_to_run( object ):
780780 RunInfo = self .session .get_dbtype (conddb .RunInfo )
781781 minTs = datetime .datetime .utcfromtimestamp ( int (ks [0 ]) >> 32 )
782782 maxTs = datetime .datetime .utcfromtimestamp ( int (ks [len (ks )- 1 ]) >> 32 )
783+ if self .session .query (RunInfo .end_time ).filter (RunInfo .end_time > minTs ).count () == 0 :
784+ raise Exception ("Lower IOV sincetimestamp %s cannot be matched with an existing run in the database." % minTs )
783785 firstRun = self .session .query (sqlalchemy .func .min (RunInfo .run_number )).filter (RunInfo .end_time > minTs ).one ()[0 ]
786+ if self .session .query (RunInfo .start_time ).filter (RunInfo .start_time < maxTs ).count () == 0 :
787+ raise Exception ("Upper iov since timestamp %s cannot be matched with an existing run in the database" % maxTs )
784788 lastRun = self .session .query (sqlalchemy .func .max (RunInfo .run_number )).filter (RunInfo .start_time < maxTs ).one ()[0 ]
785789 runs = self .session .query (RunInfo .run_number ,RunInfo .start_time ,RunInfo .end_time ).filter (RunInfo .run_number >= firstRun ).filter (RunInfo .run_number <= lastRun ).order_by (RunInfo .run_number ).all ()
786790 newiovs = {}
You can’t perform that action at this time.
0 commit comments