Skip to content
This repository has been archived by the owner on Jul 30, 2024. It is now read-only.

Commit

Permalink
squad-show-or-cancel: cancel jobs x hours ago
Browse files Browse the repository at this point in the history
There's a need to be more granular than days. So lets add hours so jobs
can be shown or canceled x hours ago.

Signed-off-by: Anders Roxell <[email protected]>
  • Loading branch information
roxell committed May 15, 2024
1 parent 430100f commit aaca67e
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions squad-show-or-cancel-jobs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,16 @@ def arg_parser():
"--days",
required=False,
default=10,
help="environment",
type=int,
help="days",
)

parser.add_argument(
"--hours",
required=False,
default=0,
type=int,
help="hours",
)

parser.add_argument(
Expand Down Expand Up @@ -87,7 +96,9 @@ def run():
logger.error(f"Get project failed. Project not found: '{args.project}'.")
return -1

n_days_ago = str(datetime.now() - timedelta(days=int(args.days))).replace(" ", "T")
n_days_ago = str(
datetime.now() - timedelta(days=args.days, hours=args.hours)
).replace(" ", "T")
jobs = (
Squad()
.testjobs(
Expand Down

0 comments on commit aaca67e

Please sign in to comment.