Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IdleTask 不支持 delay #8

Open
woxin123 opened this issue Sep 9, 2024 · 0 comments
Open

IdleTask 不支持 delay #8

woxin123 opened this issue Sep 9, 2024 · 0 comments

Comments

@woxin123
Copy link

woxin123 commented Sep 9, 2024

如题 IdleTask 不支持 delay,并且没有任何提示和报错。

public void triggerIdleRun() {
    // removed from taskContainer
    Task request = TaskContainer.getInstance().offerTaskInIdleState(false);
    if (request != null) {
        if (request instanceof IdleTask) {
            //can run more than one task in one trigger
            ((IdleTask) request).updateIdleOffset(mConfig.getIdleTaskOffset());
        }
        request.updateDelay(0);//[已经设置过的]
        if (Looper.myLooper() == Looper.getMainLooper()) {
            executeDirect(request);
        } else {
            enqueue(request);
        }
    } else {
        // when is idle , notify executor to run junk tasks
        mTaskExecutor.trigger();
    }
}

这里会把 delay 设置为 0。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant