-
Notifications
You must be signed in to change notification settings - Fork 128
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
Ng Idle pauses when system goes to sleep mode #112
Comments
I'm experiencing a similar issue with the system going to sleep. idle occurs, laptop sleeps, laptop wakes and then onIdleEnd does not fire. To duplicate: after waking idle.isRunning() = false. |
Ok, so immediately after posting my issue with onIdleEnd I figured out my mistake. If I didn't post, I'd have never figured it out. There is a timeout after onIdleStart that defaults to 30 seconds. I added this line and things are working fine now. I also tested a sleep for the idle to fire: This particular timer is using SimpleExpiry. I've not tested this use case with IdleExpiry. |
By default when it goes idle it then starts a timeout timer. If there is no activity within that timer then it exits. Meaning, it will never pickup again and isn't watching for activity anymore. If you setTimeout(false) then that second timer starts so it never exits the process.
My purpose was to fire events always on idle / on no longer idle.
…________________________________
From: Andrew Lobban <notifications@github.com>
Sent: Friday, October 5, 2018 10:25 AM
To: HackedByChinese/ng2-idle
Cc: Shawn; Mention
Subject: Re: [HackedByChinese/ng2-idle] Ng Idle pauses when system goes to sleep mode (#112)
@earbullet<https://github.com/earbullet> can you explain why setting this.idle.setTimeout(false) came about? Would this affect the app from ever going back into an idle state? Or was this only meant for the laptop snoozing?
My issue is that '6.0.0-beta.3doesn't seem to be firingonIdleEnd`. So I don't see my log statement if it is being fired.
idle.onIdleEnd.subscribe(() => {
this.hasIdled = false;
this.idleState = `No longer idle.`;
this.status = { state: this.idleState, active: this.hasIdled };
console.log('Act-Mon', this.status.state);
this.amService.setStatus(this.status);
});
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub<#112 (comment)>, or mute the thread<https://github.com/notifications/unsubscribe-auth/AR0M8Bv6984rxOJRw58_ekU1D3rkZZjqks5uh2vngaJpZM4Vr9F0>.
|
@earbullet can you indicate where you added this line of code? |
Right before I started the watch. It's a configuration for that particular idle service. When the user goes idle should you timeout or wait for them to become active again.
this._idle.setTimeout(false);
this._idle.watch();
…________________________________
From: Andrew Lobban <notifications@github.com>
Sent: Friday, October 5, 2018 10:51 AM
To: HackedByChinese/ng2-idle
Cc: Shawn; Mention
Subject: Re: [HackedByChinese/ng2-idle] Ng Idle pauses when system goes to sleep mode (#112)
@earbullet<https://github.com/earbullet> can you indicate where you added this line of code?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub<#112 (comment)>, or mute the thread<https://github.com/notifications/unsubscribe-auth/AR0M8Hc9xFrCzxsi4YxDQOA1oDqwC-4qks5uh3IPgaJpZM4Vr9F0>.
|
@earbullet what is the actual solution for this issue ? |
|
Does not works on Mac! |
This is not a solution to the problem, this only disables the timeout function. I want to use the idle and timeout function, and that it takes into account if the user shutdown or put to sleep the computer. |
I have used Ng Idle version 6.0.0-beta.3 and using angular 6, this library is working fine system is on but timer stops when system goes to sleep mode. How to achieve idle state is system goes to sleep?
The text was updated successfully, but these errors were encountered: