Re: [WebDNA] triggers executed at boot instead of scheduled time
This WebDNA talk-list message is from 2011
It keeps the original formatting.
numero = 107174
interpreted = N
texte = Hi Steve,As mentioned in the trigger admin:"The trigger will execute if it is enabled, and the NextExecute timeis earlier than the current time"My guess is that the NextExecute had passed while your server was having issues..Anyway,I don't like to rely on triggers to run code at certain times.Instead, I wrap my code to be fired in a "time wrapper"..ie. (code to be ran once daily)-----------------------------------------------------------[if ({[time]} < {sometime}) & ({[time]} > {sometime})] [then] [!] ** Some solution to know if already hit today ** [/!] [text]t_lasthit=[lookup db=codehit.db&lookinfield=ch_date&value=[date]&returnfield=ch_id¬found=NF] [showif [t_lasthit]=NF] < Run your code > [!] ** record hit ** [/!] [append db=codehit.db&autonumber=CH_ID]ch_date=[url][date][/url][/append] [/showif] [/then][/if]------------------------------------------------------------Then set up a trigger that fires every minute or so.. enough topass the initial condition a few times (for redundancy).Hope that helps to avoid future problems.Donovan-- Donovan BrookeEuca Design Center[Practical-Ethical-Efficient]www.euca.usegg.bzartglass-forum.com
Associated Messages, from the most recent to the oldest:
Hi Steve,As mentioned in the trigger admin:"The trigger will execute if it is enabled, and the NextExecute timeis earlier than the current time"My guess is that the NextExecute had passed while your server was having issues..Anyway,I don't like to rely on
triggers to run code at certain times.Instead, I wrap my code to be fired in a "time wrapper"..ie. (code to be ran once daily)-----------------------------------------------------------[if ({
[time]} < {sometime}) & ({
[time]} > {sometime})] [then]
[!] ** Some solution to know if already hit today ** [/!]
[text]t_lasthit=[lookup db=codehit.db&lookinfield=ch_date&value=
[date]&returnfield=ch_id¬found=NF] [showif [t_lasthit]=NF] < Run your code >
[!] ** record hit ** [/!] [append db=codehit.db&autonumber=CH_ID]ch_date=
[url][date][/url][/append] [/showif] [/then][/if]------------------------------------------------------------Then set up a trigger that fires every minute or so.. enough topass the initial condition a few times (for redundancy).Hope that helps to avoid future problems.Donovan-- Donovan BrookeEuca Design Center[Practical-Ethical-Efficient]www.euca.usegg.bzartglass-forum.com
Donovan Brooke
DOWNLOAD WEBDNA NOW!
Top Articles:
Talk List
The WebDNA community talk-list is the best place to get some help: several hundred extremely proficient programmers with an excellent knowledge of WebDNA and an excellent spirit will deliver all the tips and tricks you can imagine...
Related Readings:
WebCat Versions (2003)
Eudora Plugin (1999)
UPS Calculator (2003)
Price spread (2002)
lookups or math? (1998)
Large databases in WebCat (1997)
[include] affect on filepaths for links? (1997)
[WebDNA] Sandbox question (2009)
Re:E-mailer application times out (1998)
Running _every_ page through WebCat ? (1997)
Looping (2000)
# fields limited? (1997)
What is this error message? (2006)
Frames and WebCat (1997)
WC1.6 to WC2 date formatting (1997)
[Sum] function? (1997)
calculating tax rates, mail order solutions and version 2 (1997)
WebCat2 - [format thousands] (1997)
WebDNA - fun to compare (2005)
searching twice on same field (1998)