Advertisement:

Author Topic: Timeout for Alert  (Read 2097 times)

Offline Bigguy

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 12,705
  • Gender: Male
  • Be nice, or else....
    • smfbigguy on GitHub
    • Whats Ur Beef
Timeout for Alert
« on: September 08, 2018, 08:05:38 PM »
What does this setting mean in 2.1 under notifications in your profile.

Timeout for Alert desktop notifications

Is this in minutes or seconds or days, lol.

Offline Bigguy

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 12,705
  • Gender: Male
  • Be nice, or else....
    • smfbigguy on GitHub
    • Whats Ur Beef
Re: Timeout for Alert
« Reply #1 on: September 09, 2018, 09:32:56 PM »
So no one can understand this or ....???

Offline feline

  • SMF Hero
  • ******
  • Posts: 1,638
  • Gender: Female
Re: Timeout for Alert
« Reply #2 on: September 10, 2018, 03:25:43 PM »
Number of calls the cron.php ...

Offline Bigguy

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 12,705
  • Gender: Male
  • Be nice, or else....
    • smfbigguy on GitHub
    • Whats Ur Beef
Re: Timeout for Alert
« Reply #3 on: September 11, 2018, 06:31:55 AM »
I don't think that's it.

Offline shawnb61

  • Support Specialist
  • Sophist Member
  • *
  • Posts: 1,002
    • sbulen on GitHub
Re: Timeout for Alert
« Reply #4 on: September 11, 2018, 10:54:23 AM »
Pretty sure it's in seconds.  Should probably be labeled more clearly. 

Note in Sub.php it gets multiplied by 1000 before passing to .js.

In alerts.js it's passed to setTimeout, which expects ms. 

Address the process rather than the outcome.  Then, the outcome becomes more likely.   - Fripp

Offline Bigguy

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 12,705
  • Gender: Male
  • Be nice, or else....
    • smfbigguy on GitHub
    • Whats Ur Beef
Re: Timeout for Alert
« Reply #5 on: September 11, 2018, 11:47:57 AM »
SO than you want it set to zero ???

Offline shawnb61

  • Support Specialist
  • Sophist Member
  • *
  • Posts: 1,002
    • sbulen on GitHub
Re: Timeout for Alert
« Reply #6 on: September 11, 2018, 03:09:12 PM »
I am not familiar with that code, but I doubt that you want it set to 0. 

The .js timeout feature helps you avoid having .js scripts stepping on themselves, because they take time to execute.  Or avoiding scripts from running too frequently.  Too low a value would likely waste CPU on stupid stuff - looking for nothing.  It might even cause a nasty performance issue. 

I suspect this is one of those examples where having NO setting would have been better...   Just set it to 10 seconds and nobody would have known the difference, and the app would have been nice & safe...

(Speculation alert...  I have not tested this feature...)
Address the process rather than the outcome.  Then, the outcome becomes more likely.   - Fripp

Offline Bigguy

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 12,705
  • Gender: Male
  • Be nice, or else....
    • smfbigguy on GitHub
    • Whats Ur Beef
Re: Timeout for Alert
« Reply #7 on: September 11, 2018, 05:22:05 PM »
I don't want an alert system that is going to notify me 10 min after a post is made. I thought the idea was to get notifications as soon as you wanted them. If this is set as you said than it would almost have to be set at zero to get notifications instantly, would it not. ???

Pretty sure it's in seconds.  Should probably be labeled more clearly. 

Note in Sub.php it gets multiplied by 1000 before passing to .js.

In alerts.js it's passed to setTimeout, which expects ms. 



Offline shawnb61

  • Support Specialist
  • Sophist Member
  • *
  • Posts: 1,002
    • sbulen on GitHub
Re: Timeout for Alert
« Reply #8 on: September 11, 2018, 08:57:46 PM »
The default is 10 seconds.
Address the process rather than the outcome.  Then, the outcome becomes more likely.   - Fripp

Offline shawnb61

  • Support Specialist
  • Sophist Member
  • *
  • Posts: 1,002
    • sbulen on GitHub
Re: Timeout for Alert
« Reply #9 on: September 11, 2018, 09:52:20 PM »
For the record, for the reasons specified above, it will *not* let you set the timeout to 0.   

Try it!    ;D

I found a sneaky workaround...   Set it to .000001.  It's not 0 so it's allowed.  But then it gets rounded to 0 and stored as 0.   

But the code in alerts.js tests for 0 and will not overwrite the 10 second default if you do so. 

And yes, it's a polling interval.  You really don't want a value of 0.  You'd be telling your browser that's the only thing you'd ever allow it to do.  But you do, in fact, want your browser to be able to do other things.  Like actually use the site in question. 
Address the process rather than the outcome.  Then, the outcome becomes more likely.   - Fripp

Offline Bigguy

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 12,705
  • Gender: Male
  • Be nice, or else....
    • smfbigguy on GitHub
    • Whats Ur Beef
Re: Timeout for Alert
« Reply #10 on: September 12, 2018, 07:13:06 AM »
Yeah i did try to set it to zero. I have it at one now. Maybe this should be explained under the button in the admin panel to make it clear to people how to use it. Maybe add one of those question marks beside it so there is a description for it.