mirror of
https://github.com/StuffAnThings/qbit_manage.git
synced 2025-10-19 02:07:12 +08:00
Scheduler bug fix to work with docker container
This commit is contained in:
parent
fd56f43682
commit
4b338ec9e8
2 changed files with 9 additions and 3 deletions
3
.github/workflows/tag.yml
vendored
3
.github/workflows/tag.yml
vendored
|
@ -10,9 +10,8 @@ jobs:
|
|||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
with:
|
||||
token: ${{ secrets.PAT }}
|
||||
fetch-depth: 2
|
||||
- uses: salsify/action-detect-and-tag-new-version@v1.0.3
|
||||
- uses: salsify/action-detect-and-tag-new-version@v2
|
||||
with:
|
||||
version-command: |
|
||||
cat VERSION
|
|
@ -24,7 +24,7 @@ if sys.version_info[0] != 3 or sys.version_info[1] < 6:
|
|||
parser = argparse.ArgumentParser('qBittorrent Manager.',
|
||||
description='A mix of scripts combined for managing qBittorrent.')
|
||||
parser.add_argument("--run", dest="run", help="Run without the scheduler. Script will exit after completion.", action="store_true", default=False)
|
||||
parser.add_argument("-sch", "--schedule", dest="sch", help="Schedule to run every x minutes. (Default set to 30)", default=30, type=int)
|
||||
parser.add_argument("-sch", "--schedule", dest="sch", help="Schedule to run every x minutes. (Default set to 30)", default="30", type=str)
|
||||
parser.add_argument('-c', '--config-file',
|
||||
dest='config',
|
||||
action='store',
|
||||
|
@ -124,6 +124,13 @@ log_file = get_arg("QBT_LOGFILE", args.logfile)
|
|||
|
||||
default_dir = os.path.join(os.path.dirname(os.path.abspath(__file__)), "config")
|
||||
|
||||
if sch.isnumeric():
|
||||
sch = int(sch)
|
||||
else:
|
||||
print(f"Schedule Error: Schedule is not a number. Current value is set to '{sch}'")
|
||||
sys.exit(0)
|
||||
|
||||
|
||||
if not os.path.exists(os.path.join(default_dir, config_file)):
|
||||
print(f"Config Error: config not found at {os.path.join(os.path.abspath(default_dir),config_file)}")
|
||||
sys.exit(0)
|
||||
|
|
Loading…
Add table
Reference in a new issue