Skip to content

Commit

Permalink
Check --minutes before claiming to take any action
Browse files Browse the repository at this point in the history
  • Loading branch information
kfsone committed Sep 21, 2014
1 parent 09c953d commit a4c73da
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions trade.py
Original file line number Diff line number Diff line change
Expand Up @@ -685,14 +685,14 @@ def cleanupCommand(args):

global tdb

if args.minutes <= 0:
raise ValueError("Invalid --minutes specification.")

print("* Performing database cleanup, expiring {} minute orphan records.{}".format(
args.minutes,
" DRY RUN." if args.dryRun else ""
))

if args.minutes <= 0:
raise ValueError("Invalid --minutes specification.")

# Get access to the DB in a transaction so that if something goes
# wrong or we are only doing a dry run, nothing will actually happen.
db = tdb.getDB()
Expand Down

0 comments on commit a4c73da

Please sign in to comment.