This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

Trouble with cron package

Help for those learning Tcl or writing their own scripts.
Post Reply
User avatar
CrazyCat
Revered One
Posts: 1215
Joined: Sun Jan 13, 2002 8:00 pm
Location: France
Contact:

Trouble with cron package

Post by CrazyCat »

Hi there,

I've a small trouble using the cron package.
My try:

Code: Select all

.tcl ::cron::task exists test
Tcl: 0
.tcl proc mycron {} { putlog "done : [::cron::task info test]"; ::cron::in test 10 mycron}
Tcl: 
.tcl ::cron::in test 10 mycron
Tcl: test
[17:18:44] done : object {} lastevent 1623251925001 lastrun 1623251925001 err 0 result {} running 1 coroutine {} scheduled 1623251925000 frequency -1 command mycron
.tcl ::cron::task exists test
Tcl: 0
In my mind, the cron must be re-launch as I redo a ::cron::in in the procedure, but it doesn't.

If I launch it with ::cron::every, the result is:

Code: Select all

.tcl ::cron::every test 5 mycron
Tcl: after#93
[17:24:30] done : object {} lastevent 1623252271001 lastrun 1623252271001 err 0 result {} running 1 coroutine {} scheduled 1623252276000 frequency 5000 command mycron
[17:24:36] done : object {} lastevent 1623252276003 lastrun 1623252276003 err 0 result test running 1 coroutine {} scheduled 1623252281000 frequency 5000 command mycron
[17:24:41] done : object {} lastevent 1623252281002 lastrun 1623252281002 err 0 result test running 1 coroutine {} scheduled 1623252286000 frequency 5000 command mycron
[17:24:46] done : object {} lastevent 1623252286003 lastrun 1623252286003 err 0 result test running 1 coroutine {} scheduled 1623252291000 frequency 5000 command mycron
[17:24:51] done : object {} lastevent 1623252291003 lastrun 1623252291003 err 0 result test running 1 coroutine {} scheduled 1623252296000 frequency 5000 command mycron
[17:24:55] done : object {} lastevent 1623252296003 lastrun 1623252296003 err 0 result test running 1 coroutine {} scheduled 1623252301000 frequency 5000 command mycron
As you see, the process "test" is not modified with ::cron::in.

Any idea about what I do wrong or misunderstand ?
Post Reply