Commit 2ff88bda authored by EKbfh's avatar EKbfh 🐼
Browse files

Update tower/cli/joblog.py

parent eb5d7ab0
Pipeline #28123 passed with stages
in 3 minutes and 4 seconds
......@@ -108,14 +108,14 @@ def joblog_view(args):
def joblog_clean(args):
joblog_count = JobLog.filter(is_complete=True).count()
joblog_count = JobLog.count()
if args.before:
before = datetime.datetime.strptime(args.before, "%Y-%m-%d %H:%M")
cleaned_job = JobLog.filter(start_ts__gte=before, is_complete=True)
cleaned_job = JobLog.filter(start_ts__gte=before)
print(" %d JobLog before %s will be cleaned" % (cleaned_job.count(), args.before))
elif args.save_last and joblog_count > args.save_last:
cleaned_job = (
JobLog.filter(is_complete=True)
JobLog
.order_by(JobLog.start_ts)
.limit(joblog_count - args.save_last)
)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment