eschnou / storytlr

Storytlr is an opensource lifestreaming and microblogging platform written in PHP. Note: The default branch (master) is the development branch, if you need a stable version, see the release-XX branches, tags, or downloads.
http://storytlr.org
Other
216 stars 57 forks source link

Avoid using cron for automated updates. #5

Open eschnou opened 14 years ago

eschnou commented 14 years ago

Setting up a cron job can be tedious for some users. It should be possible to have storytlr update itself without cron. The idea is simple:

jmhobbs commented 14 years ago

Would we store the last run as a property I assume? What's the best way to start that processing in the background?

eschnou commented 14 years ago

Yes, I advocate using properties as much as possible to avoid adding fields to the schema. It may also be worth one day to add a system_properties table for global settings.

In this case however, we can reuse these two fields in the user table: http://github.com/storytlr/core/blob/master/protected/install/database/schema/core.sql#L451

Or this one in the source table: http://github.com/storytlr/core/blob/master/protected/install/database/schema/core.sql#L286

The trick will be to be smart enough to avoid triggering multiple updates in paralell. The updates themselves could be a fork to execute the update.php script using exec ? http://php.net/manual/en/function.exec.php

jmhobbs commented 14 years ago

I agree with all that, except that some shared hosts run suhosin with the exec family of commands disabled. Should the workaround for that just be "well, then use cron." ?

Any other options? How about a long-poll type XHR?

eschnou commented 14 years ago

Indeed, and since we want to solve the issue exactly for these kind of users, we may need to find other ways. There is also the PHP process functions, on top of which the PHP Multi-threading package is built: http://be.php.net/pcntl_fork - I have never played with this.

Another easier trick may be indeed to add something like Githubissues.

  • Githubissues is a development platform for aggregating issues.