Giter Club home page Giter Club logo

Comments (7)

jmhobbs avatar jmhobbs commented on August 17, 2024

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

from storytlr.

eschnou avatar eschnou commented on August 17, 2024

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

from storytlr.

jmhobbs avatar jmhobbs commented on August 17, 2024

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?

from storytlr.

eschnou avatar eschnou commented on August 17, 2024

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 <script href="/update"/> at the end of the page. The browser will try to load the script, triggering an update. If content is updated, the script may even trigger a notification to invite the user to refresh the page. We could also trigger the updates from storytlr.org: upon installation the storytlr ping home (may also be interesting to do just to keep track of deployments, versions, etc.) and requests that we trigger updates. Then, from storytlr.org, we ping individual storytlrs on their update url.

It seems possible to avoid threading and forking, which is probably a better option indeed.

from storytlr.

jmhobbs avatar jmhobbs commented on August 17, 2024

I like the option of the remote trigger personally. Thinking about the script inclusion some more I see potential for harm. If we didn't protect it from spamming properly it would be easy to use that as a DOS attack. It seems like the storytlr.org trigger would be easier to implement too, until all of your bandwidth is absorbed sending out GET's :-)

Either way, I think an optional installer reporting tool would be nice for us.

from storytlr.

eschnou avatar eschnou commented on August 17, 2024

Well, in both case we'll need the server to be smart enough and not update unless it is required (and avoid updating while another update is already ongoing). The script hack is worth a try. I have opened another issue for the reporting feature (issue 15).

from storytlr.

kylehase avatar kylehase commented on August 17, 2024

Don't forget that the update should be started after the page is loaded or at least at the end of script execution to minimize disruptions to the user experience.

from storytlr.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.