Call Multiple Files From Single ColdFusion Scheduled Task
- October 1, 2009
- 1 reply
- 820 views
Our host only allows us to have 5 scheduled tasks per account but we need to run cfml applications to import data for multiple sites (at least 15 processes). What I'd like to do is combine all the 'sample requests' for all sites into ONE scheduled task that will run them one after another thus cutting back on the number of scheduled tasks needed.
We're using ColdFusion to connect to a MySQL DB to gather all sample requests. First the app retrieves all the unflagged records from a remote db then begins looping through all the returned records. On the each loop, the app 'scrubs' the data by properly formatting phone numbers, fixing address abbreviations, etc. Next the app saves the scrubbed data to a local MS SQL table then starts the loop over on the next row. Lastly the app sends out an email saying it has completed successfully.
What I'm trying to do is Create a New Parent App that will run as a scheduled task to do the following:
- New Parent App Runs as Scheduled Task and calls/includes first of X sample request app files
- New Parent App runs first sample request app as described above (which can take up to a minute to process)
- Parent app waits until after first sample request app completes, then Parent App goes on to second sample request app, etc.
- After all sample requests are complete New App sends completion email with date and time
The problem I'm having is getting the scheduled task to wait for apppage1.cfm to finish before loading apppage2.cfm and so on. Can you give me a simple codeset that accomplishes this?
I've attached a sample of the include page the needs to complete before moving on!
