Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
0 votes
991 views
in Plugins by
edited by

when a cron request starts, it needs a requester not leaving the page. Else the process initiated is stopped.

The only way I found is to take the opportunity of a great download.
It's not realistic... if the downloader changes his mind and stops the download before the end of the task, the process is killed after some seconds

I have many solutions using smart servers , even if they don't cron explicitely but I'm still looking for a real independant autocron. I don't forget that 1.000.000 calls / day cost less than 10 $ / month ( small machine without apache, juste cron and mysql )

Splitting a cron task is rarely a good idea. Ie for dbsave, the database dumper, there is the risk to get a not coherent database

Do you know how other do ( without any root server trick , some webmasters are not sure to get their help ) ?

thank you for your tips

edit : I found a solution, where QA calls itself and both session use socket properties to get working the needed time

Q2A version: 1.7.1
by
If a task is long, the only way I can think of is if it can be split into smaller tasks, so each page would do a little bit of it, and then go away.  Without going to root/exec, I don't see how this could be done otherwise. So would be interested to hear as well.
by
For the moment the best solution I found needs 2 QA installations that exchange files at ie 16 bytes / minute while they do their night tasks. It might be a solid option since the file exchange resets the time-out ( like a download, it can take hours ). Testing if it is time to cron doesn't add a great overhead ( if time is between limits and if file_exists(todo) ) ; it is not measurable in a big emulation test.
by
2 QA installations ? perhaps with 2 instances of the same site !!! yes !

1 Answer

+1 vote
by

Please check out WP backup https://wordpress.org/plugins/backupwordpress/
to see how they are doing it.  It should be possible to port the idea/code to Q2A.

"Works in low memory, "shared host" environments."

by
I want to write my own plugin , not to port the work of this guy :) Now, it's done and in test phasis ...
by
it works :) to get the cron done, one must expect a visit on the main page by anything even an engine. Overhead average : 0.75 ms when ordering the task and 0 otherwise. I still don't know how they do exactly but this solution handles only the dbsave cron ( as tonight )
by
it worked fine during 30 min several times. I'm glad because I saw pages and pages and didn't read any. I found all the models in the php.net documentation :) But , now I have to deal with the php memory limitations. The cron plugin is allmost ready.
by
memory limitations, done ... now, the mysql 'bit(1)' bug ... to get an universal test working , thinking to the abominable case of a new admin table with a 'bit' field.
...