termux / termux/termux-api

cant add multiple jobs through termux-job-scheduler?

Open
#368 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug report
Dominant language
Java
Stars
4.3k
Forks
920
PR merge metrics
No merged PRs in 30d

Description

Problem description

scheduling multiple jobs through termux-job-scheduler with persisted option does not add jobs to the queue, instead it just overwrites the previous one.
Steps to reproduce

termux-job-scheduler -s /data/data/com.termux/files/home/script2.sh --persisted true --period-ms 300000 --job-id 1
termux-job-scheduler -s /data/data/com.termux/files/home/script2.sh --persisted true --period-ms 300000 --job-id 2
these commands only lead to the last job scheduled at job-id 2.
Pending Job 2: /data/data/com.termux/files/home/script2.sh (periodic: 900000ms) (persisted) (battery not low) (network: NetworkRequest [ NONE id=0, [ Capabilities: INTERNET&NOT_RESTRICTED&TRUSTED&VALIDATED Uid: 10288] ])

Expected behavior

there should be two jobs scheduled with job-id 1 and job-id 2 for each scripts.
Additional information

  • Termux application version: 0.99
  • Android OS version: 10
  • Device model: MiA1

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the two termux-job-scheduler commands with job IDs 1 and 2 and the persisted option. Then trace the termux-job-scheduler entry point and Android job scheduling code to determine why the second job replaces the first; done means both jobs remain queued with their respective IDs and the behavior is covered by an appropriate test.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, java
Domain
cli, mobile
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.