yigit / android-priority-jobqueue

A Job Queue specifically written for Android to easily schedule jobs (tasks) that run in the background, improving UX and application stability.
3.4k stars 395 forks source link

Job not running #443

Open d3bt3ch opened 6 years ago

d3bt3ch commented 6 years ago

A strange problem started only recently. One of the jobs in the app is geting added but not running.

`public class TestJob extends Job {

private static final String TAG = "TestJob";

/**
 * ctor
 */
public TestJob() {
    super(new Params(JobPriority.NORMAL).persist());
}

@Override
public void onAdded() {
    Log.d(TAG, "Job added");
}

@Override
public void onRun() throws Throwable {
    Log.d(TAG, "Job running");
}

@Override
protected void onCancel(int cancelReason, @Nullable Throwable throwable) {
    Log.d(TAG, "Job cancelled");
}

@Override
protected RetryConstraint shouldReRunOnThrowable(@NonNull Throwable throwable, int runCount, int maxRunCount) {
    return RetryConstraint.createExponentialBackoff(runCount, 1000);
}

}`

d3bt3ch commented 6 years ago

Surprising. If I dont make the job persistent then it works.

[EDIT] Its not working again.

kalpeshp0310 commented 6 years ago

@debjitk Do you get callback on onAdded function?