Welcome to Geeklog, Anonymous Saturday, November 30 2024 @ 09:43 pm EST
Geeklog Forums
Scheduler and gl_vars question.
Status: offline
Laugh
Site Admin
Admin
Registered: 09/27/05
Posts: 1470
Location:Canada
I am updated the great links plugin (coded by dirk and others) included with geeklog 1.4 to suit my own needs and I have a few questions.
I am converting links to a link exchange plugin and am basically finished except to implement a scheduled execution of the link check code.
I started the scheduling code and noticed in the gl_vars table that there is a last_scheduled_run record.
Is there a scheduler already in geeklog or is this record for some other purpose?
What are the rules regarding this gl_vars table? I need to store 2 values (when schedule last run and how many days to next run). Are these gl_vars table values stored in some global array that geeklog loads or do I just retrieve the variables (and update them) when I need to with my own code?
Thanks for any replies.
One of the Geeklog Core Developers.
I am converting links to a link exchange plugin and am basically finished except to implement a scheduled execution of the link check code.
I started the scheduling code and noticed in the gl_vars table that there is a last_scheduled_run record.
Is there a scheduler already in geeklog or is this record for some other purpose?
What are the rules regarding this gl_vars table? I need to store 2 values (when schedule last run and how many days to next run). Are these gl_vars table values stored in some global array that geeklog loads or do I just retrieve the variables (and update them) when I need to with my own code?
Thanks for any replies.
One of the Geeklog Core Developers.
8
7
Quote
Status: offline
Dirk
Site Admin
Admin
Registered: 01/12/02
Posts: 13073
Location:Stuttgart, Germany
There is a sort of "pseudo crontab" built into Geeklog as of 1.4.0, but it's not really documented anywhere I guess ... Search for "schedule" in config.php, system/lib-custom.php and lib-common.php and see if you can figure it out from there.
As for gl_vars, there's a sort of convention to prefix the names of your own entries with the name of your plugin. So the links plugin would use, say, "links.whatever" to store a "whatever" value.
Other than that, as long as you don't interfere with the values Geeklog stores there, you're free to use that table to store your own values. Of course, if you have a lot of information to store, it would make more sense to have your own table.
bye, Dirk
As for gl_vars, there's a sort of convention to prefix the names of your own entries with the name of your plugin. So the links plugin would use, say, "links.whatever" to store a "whatever" value.
Other than that, as long as you don't interfere with the values Geeklog stores there, you're free to use that table to store your own values. Of course, if you have a lot of information to store, it would make more sense to have your own table.
bye, Dirk
8
8
Quote
Status: offline
Laugh
Site Admin
Admin
Registered: 09/27/05
Posts: 1470
Location:Canada
Thanks for the tip and I got it working. Only problem is that the task being schedule can take a while to run so who ever gets stuck triggering the scheduled task gets a blank page until the task is complete.
The way i did it was an image request on a page ( 1 pixel x 1 pixel) triggered some php code to do the check. The page would all be loaded except for the image.
Is there a plan to update the scheduler to fix this issue as well as scheduling different tasks at different times (instead of one triggered time for all scheduled tasks?
One of the Geeklog Core Developers.
The way i did it was an image request on a page ( 1 pixel x 1 pixel) triggered some php code to do the check. The page would all be loaded except for the image.
Is there a plan to update the scheduler to fix this issue as well as scheduling different tasks at different times (instead of one triggered time for all scheduled tasks?
One of the Geeklog Core Developers.
7
6
Quote
All times are EST. The time is now 09:43 pm.
- Normal Topic
- Sticky Topic
- Locked Topic
- New Post
- Sticky Topic W/ New Post
- Locked Topic W/ New Post
- View Anonymous Posts
- Able to post
- Filtered HTML Allowed
- Censored Content