From: Jason R. <ja...@ho...> - 2006-11-14 14:08:54
|
A job queue in the DB and a cron job that reads the DB and executes it is the best way probably. If you did not have access to cron on your system, another way would be to use fork/exec and have the child job sleep for 5 minutes and then check the state of a flat file or DB for cancellation. Hank Marquardt wrote: > Ohhh, one gotcha. Never set your interval shorter than the time the > job takes to run ... bad things happen :) > > On 11/13/06, *Hank Marquardt* < hma...@gm... > <mailto:hma...@gm...>> wrote: > > cron job. put a time stamp in the database, cron job checks the > timestamp and executes all records > 5 minutes ... if you execute > the cronjob every 5 minutes then the longest one would sit is 9:59 > ... shorten the interval, shorten the length ... > > Could do the same thing with timestamps on files if you don't want > to do the database thing. > > > > On 11/13/06, * Terry* < ma...@ao... <mailto:ma...@ao...>> wrote: > > > How can I run a script 5 min after a user does something? > > I want to give a user 5 minutes to cancel an action, and if they > don't > then it actually happens. So, I'd like to run a script 5 minutes > later, > and have it perform any actions in the queue that are 5+ minutes > old. 5 > min is not critical, but I don't think I should wait longer than 10 > min. > > What if it's only needed very infrequently? > > I'm thinking the options are to use a cron job that runs every few > minutes, or, call the script with curl and have it sleep for 5 > minutes > first. > > Terry > > > ------------------------------------------------------------------------- > Using Tomcat but need to do more? Need to support web services, > security? > Get stuff done quickly with pre-integrated technology to make > your job easier > Download IBM WebSphere Application Server v.1.0.1 based on > Apache Geronimo > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 > <http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642> > _______________________________________________ > chiPHPug-discuss mailing list > chi...@li... > <mailto:chi...@li...> > https://lists.sourceforge.net/lists/listinfo/chiphpug-discuss > > > > > ------------------------------------------------------------------------ > > ------------------------------------------------------------------------- > Using Tomcat but need to do more? Need to support web services, security? > Get stuff done quickly with pre-integrated technology to make your job easier > Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 > > > ------------------------------------------------------------------------ > > _______________________________________________ > chiPHPug-discuss mailing list > chi...@li... > https://lists.sourceforge.net/lists/listinfo/chiphpug-discuss |