Skip to content

termux-job-scheduler: New jobs default to job ID 0 #164

@Terrance

Description

@Terrance

Problem description

When creating a new job, with no ID given it assumes ID 0 and replaces an existing job of that ID.

Steps to reproduce

$ termux-job-scheduler -s ~/jobs/one.sh --period-ms 14400000
Scheduling Job 0: /data/data/com.termux/files/home/jobs/one.sh       (periodic: 14400000ms) ... - response 1

$ termux-job-scheduler -s ~/jobs/two.sh --period-ms 14400000
Scheduling Job 0: /data/data/com.termux/files/home/jobs/two.sh       (periodic: 14400000ms) ... - response 1

Expected behavior

I'd expect the default behaviour to choose the next available job number and not replace an existing job.

  --job-id int               job id (will overwrite any previous job with the same id)

This reads to me like it will override a job only if you explicitly give it an existing job ID (it doesn't specify a default of 0).

Additional information

$ termux-info
Termux Variables:
TERMUX_APP_PACKAGE_MANAGER=apt
TERMUX_MAIN_PACKAGE_FORMAT=debian
TERMUX_VERSION=0.118.0
Packages CPU architecture:
aarch64
Subscribed repositories:
# sources.list
deb https://grimler.se/termux/termux-main stable main
Updatable packages:
All packages up to date
termux-tools version:
1.31.0
Android version:
12
Kernel build information:
Linux localhost 4.19.157-perf+ #1 SMP PREEMPT Sat Sep 17 00:13:28 CST 2022 aarch64 Android
Device manufacturer:
OnePlus
Device model:
EB2103

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions