Skip to content

Commit d83daf4

Browse files
elit0451Zeegaan
authored andcommitted
Reduce the time when getRemainingTimeoutSeconds request is made from 30s to 20s, so fewer calls are made
1 parent 2ad5ecd commit d83daf4

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/Umbraco.Web.UI.Client/src/common/services/user.service.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -65,17 +65,17 @@ angular.module('umbraco.services')
6565
//countdown by 5 seconds since that is how long our timer is for.
6666
currentUser.remainingAuthSeconds -= 5;
6767

68-
//if there are more than 30 remaining seconds, recurse!
69-
if (currentUser.remainingAuthSeconds > 30) {
68+
//if there are more than 20 remaining seconds, recurse!
69+
if (currentUser.remainingAuthSeconds > 20) {
7070

7171
//we need to check when the last time the timeout was set from the server, if
72-
// it has been more than 30 seconds then we'll manually go and retrieve it from the
72+
// it has been more than 20 seconds then we'll manually go and retrieve it from the
7373
// server - this helps to keep our local countdown in check with the true timeout.
7474
if (lastServerTimeoutSet != null) {
7575
var now = new Date();
7676
var seconds = (now.getTime() - lastServerTimeoutSet.getTime()) / 1000;
7777

78-
if (seconds > 30) {
78+
if (seconds > 20) {
7979

8080
//first we'll set the lastServerTimeoutSet to null - this is so we don't get back in to this loop while we
8181
// wait for a response from the server otherwise we'll be making double/triple/etc... calls while we wait.
@@ -116,7 +116,7 @@ angular.module('umbraco.services')
116116
countdownUserTimeout();
117117
}
118118
else {
119-
//we've got less than 30 seconds remaining so let's check the server
119+
//we've got less than 20 seconds remaining so let's check the server
120120

121121
if (lastServerTimeoutSet != null) {
122122
//first we'll set the lastServerTimeoutSet to null - this is so we don't get back in to this loop while we

0 commit comments

Comments
 (0)