You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Feb 26, 2023. It is now read-only.
When calling a background method delayed with a delay and serial from a method entry with the same serial, the remaining delay of method delayed is calculated wrong after the execution of entry.
@Background(serial = "foo")
protected void entry() {
long executionTime = System.currentTimeMillis();
delayed(executionTime);
}
@Background(serial = "foo", id = "delayedTask", delay = 20000L)
protected void delayed(final long execTime) {
boolean test = System.currentTimeMillis() - execTime >= 20000L;
Log.d("bug", String.valueOf(test));
}
The test returns false.
This is caused by wrong calculation in BackgroundExecutor Line 429. It calculates the delay of the next task from the targetTimeMillis of the currently finishing task when it should use targetTimeMillis of the next task.
Note
I did not test the behaviour of the @UiThread executor. It could be possible the issue occurs there as well.
Version 4.0 Snapshot
When calling a background method
delayedwith a delay and serial from a methodentrywith the same serial, the remaining delay of methoddelayedis calculated wrong after the execution ofentry.The test returns
false.This is caused by wrong calculation in BackgroundExecutor Line 429. It calculates the delay of the next task from the
targetTimeMillisof the currently finishing task when it should usetargetTimeMillisof the next task.Note
I did not test the behaviour of the @UiThread executor. It could be possible the issue occurs there as well.