[WebDNA] Daily tasks without triggers

This WebDNA talk-list message is from

2011


It keeps the original formatting.
numero = 107191
interpreted = N
texte = > Hot stuff, this is a brilliant idea, why didnt I think of > this. Thanks a bunch, this will allow me to figure out > when something hasnt triggered that is supose to trigger. I find that on most sites I have a good reason to run some code once a day, but it really doesn't matter what time of the day it runs. If you have the same need just put this into your home page, or whatever other page gets at least one visit per day: [showif [date]![include dailyTasksDate]] your code goes here ... [writefile dailyTasksDate][date][/writefile] [/showif] This will insure that your code is run once a day, upon the first page visit of the day, then it won't run again until the first visit on the next day. No triggers required. To alert yourself that this code was run, just put this inside the showif: [sendmail from=&to=&subject=Daily tasks: [time]][/sendmail] Or if you won't want a daily email just log the daily tasks like this: [appendfile dailyTasksLog][date] [time] [ipaddress] [/appendfile] If you're running lots of code it will speed things up by putting it inside a separate "dailyTasks" file so that WebDNA does not have to parse it all. This technique usually helps in other places in the website too: [showif [date]![include dailyTasksDate]] [include dailyTasks] [writefile dailyTasksDate][date][/writefile] [/showif] And if you're running code that takes a long time to run, you can improve the page load speed for your first visitor of the day with this technique: [showif [date]![include dailyTasksDate]] [spawn] [include dailyTasks] [writefile dailyTasksDate][date][/writefile] [/spawn] [/showif] Sincerely, Kenneth Grome Associated Messages, from the most recent to the oldest:

    
  1. Re: [WebDNA] Daily tasks without triggers (Marc Thompson 2011)
  2. [WebDNA] Daily tasks without triggers (Kenneth Grome 2011)
> Hot stuff, this is a brilliant idea, why didnt I think of > this. Thanks a bunch, this will allow me to figure out > when something hasnt triggered that is supose to trigger. I find that on most sites I have a good reason to run some code once a day, but it really doesn't matter what time of the day it runs. If you have the same need just put this into your home page, or whatever other page gets at least one visit per day: [showif [date]![include dailyTasksDate]] your code goes here ... [writefile dailyTasksDate][date][/writefile] [/showif] This will insure that your code is run once a day, upon the first page visit of the day, then it won't run again until the first visit on the next day. No triggers required. To alert yourself that this code was run, just put this inside the showif: [sendmail from=&to=&subject=Daily tasks: [time]][/sendmail] Or if you won't want a daily email just log the daily tasks like this: [appendfile dailyTasksLog][date] [time] [ipaddress] [/appendfile] If you're running lots of code it will speed things up by putting it inside a separate "dailyTasks" file so that WebDNA does not have to parse it all. This technique usually helps in other places in the website too: [showif [date]![include dailyTasksDate]] [include dailyTasks] [writefile dailyTasksDate][date][/writefile] [/showif] And if you're running code that takes a long time to run, you can improve the page load speed for your first visitor of the day with this technique: [showif [date]![include dailyTasksDate]] [spawn] [include dailyTasks] [writefile dailyTasksDate][date][/writefile] [/spawn] [/showif] Sincerely, Kenneth Grome Kenneth Grome

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:

How can I Add several Items into the cart at once? (1997) PCS Emailer's role ? (1997) form data submission gets truncated (1997) Question about links (1999) PCS Frames-Default page is solution! (1997) Great product and great job ! (1997) formulas.db problem solved (1998) [SearchString] problem with [search] context (1997) WebCatalog2 Feature Feedback (1996) WebCat editing, SiteGuard & SiteEdit (1997) Setting up WebCatalog with Retail Pro data (1996) what include am I using! (2005) RE: PIXO support (1997) More help for discount pricing (1998) Stumpted Again (1997) Problem (1997) reservation program (2000) math on date? (1997) Separate SSL Server (1997) Special characters in field names (1998)