Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New to the CF scene
    Join Date
    Sep 2011
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Javascript disable on server restart

    I have a server that when restarted emails from the code below every single time. I would like to know what I can use in the code below to regonize the restart and bypass the email send piece in BOLD below.

    Any help will be greatly appreciated.

    now = currentDateTime()
    if (statusInOverride != lastOverrideValue) or (overrideTime != lastOverrideTime)
    lastOverrideValue = statusInOverride
    lastOverrideTime = overrideTime
    if statusInOverride.value == true
    overrideStopTime = now
    overrideStopTime.minute = now.minute + overrideTime
    // Also send an email
    overrideHours = overrideTime / 60
    mailSend(address, suiteName + " Overridden", suiteName + " has been overridden for " + overrideHours + " hours.");


    else
    mailSend(address, suiteName + " Override Canceled", suiteName + " has canceled their override. There was " + remainingTime + " remaining.");
    remainingTime.duration = 0

    endif
    endif

    if statusInOverride.value == true
    remainingTime.duration = delta(now, overrideStopTime)
    endif

  • #2
    Regular Coder
    Join Date
    Mar 2008
    Location
    London
    Posts
    152
    Thanks
    4
    Thanked 42 Times in 42 Posts
    I am not aware what kind of server you are using...

    but is would be the usual scenario...

    you can use the application level attribute to detect the server start. read the value of that attribute, if true, bypass the mailSend feature and set its value to false, so that next time it mailSend can work.

    Also, the value of this attribute won't be set to true until the server is restarted.

    Thanks & Regards,
    Niral Soni

  • #3
    New to the CF scene
    Join Date
    Sep 2011
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    thanks for your help, but I was looking more for the actual code than an explanation. I am not super preficient with JAVAscript.

    thank you though,

  • #4
    Regular Coder
    Join Date
    Mar 2008
    Location
    London
    Posts
    152
    Thanks
    4
    Thanked 42 Times in 42 Posts
    your problem has nothing to do with JavaScript...
    JavaScript runs at client side....It can not control or fetch the state of your Server, until and unless valid information is available..

    Anyway, which server technology you are using ?
    May be we can help you out after knowing that ...


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •