MyBB Community Forums

Full Version: MyBB tasks engine doesn't work because of wrong time
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi there,
I encountered an error with my Board's tasks manager. Tasks won't run automatically, just because a wrong time is set in their execution.

Eg.: right now GMT+1 and DST as active is set (so the board's time is actually 11:17 AM), but tasks are set for GMT time, and next execution for an every-minute task is set to 9:18 AM.

I'm using MyBB 1.6.7. I modified a lot of core files, but I don't think it's a matter of this, just because I've installed a fresh copy of MyBB 1.6.8 and the GMT/DST error seems to be there.

I checked other threads related to this issue, but didn't find a solution. $task_image is correctly present in footer template.

Since I'm developing my board as a new and secret project, I prefer to send a link of my board to people who will help me into find some solutions, if they claim a link is necessary. I will also provide a temporary admin account. Thank you for your support.
This happened to me, the way I resolved it was:

Delete the task and recreate it again. This then synchronizes the time correctly.
I tried but nothing happened. Tasks' time continues to be GMT+0 whereas I'd like to see it set to GMT+1 and DST enabled.

Also, I tried setting from ACP: GMT+0 and DST disabled, from UCP: GMT+0 and DST disabled, just to try and see if with normal settings might work. Tasks won't work, time is set correctly though. I know tasks won't run if there are no users visiting the board, but actually there's me and another user browsing it... Sad

Update: I did a TRUNCATE mybb_tasklog to see what tasks and at what hour are being executed.

Finally I realized that tasks are correctly executed, though time isn't displayed correctly. Also, tasks are being run 2/3 minutes later than the actual execution time.

Eg.: exec time set for 14:40, task runs at 14:42/3. Don't know actually why.
Probably your server clock is different than the one you are comparing to.
Even though the task is set to run at 14:40, because of the way the task system works, it won't run again until some visits your forum.

So the task is set to run at 14:40
|-- Someone visits your forum at 14:42, task is run
(2012-06-23, 03:14 PM)Tomm M Wrote: [ -> ]Even though the task is set to run at 14:40, because of the way the task system works, it won't run again until some visits your forum.

So the task is set to run at 14:40
|-- Someone visits your forum at 14:42, task is run

Unless you use crons.
Well, I knew this before. Although I'm visiting the Forum (and also other people do) and task.php is initialized, tasks won't run. I've checked my server clock time with a simple php script and it's synchronized with my board's one.

I don't actually know how to do a cron job. I've heard of them and read something on MyBB's wiki, but I don't actually know how-to, since I'm italian and I can't understand properly english technical explainations. Do I have to add at the end of functions_task.php a line of code with:

php /my/forum/url/task.php x * * * * * *

and x stands for task's id?

Ok, after some tests I can confirm that the task scheduling system works with 2 or more users connected at the same time (2 different IPs).

Thus is not a particular problem (I'm planning to have hundreds of users connected at the same time in my final release), it took me an entire day to sort it out. Maybe MyBB's devs can update the official FAQ and Wiki with some lines telling users how Task Scheduling system actually works. If it's already there, well, I don't know where.

The last issue I'd like to solve is the fact that time of execution is displayed GMT+0 and DST disabled, regardless from ACP time settings.

Bump! Smile
Bump!
Okay,

Finally I got same situation and same problem with this task engine.
After upgrade from 1.6.7 into 1.6.8
Task did not running at expected time.
I don't know whether this is server related issue or MyBB upgrade?

Solution from Vernier is working!
Deleted task, and recreation again.

After testing some task running every minute, then task log appear..
GMT setting does not affecting.
Now, working as expected..

except, User Pruning and Thread Views didn't make Log Wink

Thank You.