Skip to content

Commit

Permalink
Added --to switch to archiving-summary. #1391
Browse files Browse the repository at this point in the history
  • Loading branch information
mfeit-internet2 committed Jul 22, 2024
1 parent 5e12ddd commit a32b6fc
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion pscheduler-core/pscheduler-core/archiving-summary
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ Example:
check-archiving PT23M
Check on archiving for runs in the last 23 minutes
check-archiving --to 2024-07-22T12:34:56Z PT23M
Check on archiving for runs in the 23 minutes leading
up to 2024-07-22T12:34:56Z
'''
)
opt_parser.disable_interspersed_args()
Expand All @@ -55,6 +59,11 @@ opt_parser.add_option('--host',
action='store', type='string',
dest='host')

opt_parser.add_option('--to',
help='Check archiving leading up to the ISO8601 time specified',
action='store', type='string',
dest='to')

opt_parser.add_option('--verbose',
help='Add additional information where appropriate',
default=False,
Expand Down Expand Up @@ -83,7 +92,13 @@ if delta > datetime.timedelta(hours=6):
print(f'Warning: Long time deltas may put a heavy load on the pScheduler server.', file=sys.stderr)


now = pscheduler.time_now()
if options.to is None:
now = pscheduler.time_now()
else:
try:
now = pscheduler.iso8601_as_datetime(options.to)
except ValueError as ex:
pscheduler.fail(f'{options.to}: {ex}')

#
# Fetch the schedule
Expand Down

0 comments on commit a32b6fc

Please sign in to comment.