Giter Club home page Giter Club logo

Comments (5)

imTigger avatar imTigger commented on May 20, 2024 2

Transaction support is added in 1.1.0-rc1

from laravel-job-status.

tpetry avatar tpetry commented on May 20, 2024 1

Hey, that's my problem, too: I have a job that performs operations on the database for up to 5 minutes and i would like to provide the user with progress information.

How about alternatively storing job status information in redis instead of the database? This would also solve the efficiency problem that when saving fine-granular Progress updates a lot of database updates take place.

A disadvantage of course is that no eloquent models can be used anymore. But since the model could not be changed anyway (#17) it is probably not a problem at all. There would only have to be a (static) function to get the current status information based on a job ID.

from laravel-job-status.

imTigger avatar imTigger commented on May 20, 2024

DB::beingTransaction() seems to be connection-wide.
There seems no way to commit immediately inside a transaction.
Unless we open another connection, but still need some testing

from laravel-job-status.

SlyDave avatar SlyDave commented on May 20, 2024

Yeah, this is pretty much going to need a secondary connection to work.
Then it's going to need some finally keyword play to handle errors in the executing job to set the status.

I wonder if it's possible to clone the connection based upon the existing connection configuration, otherwise we enter the territory of having to get people to configure a second connection just to use this - which isn't ideal...

from laravel-job-status.

crashkonijn avatar crashkonijn commented on May 20, 2024

We could do something like this, although I can't really oversee possible side effects of this:

$c1 = app('db.connection');
$c2 = clone $c1;

$c1->transaction(function () use ($c2) {
    $c2->table('job_statuses')->delete(); // this still deletes everything
});

from laravel-job-status.

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.