Comments (5)
Transaction support is added in 1.1.0-rc1
from laravel-job-status.
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.
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.
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.
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)
- retry the job HOT 1
- Undefined index: command HOT 4
- Add feature addOutput method HOT 1
- $this->setProgressMax() not woking? HOT 2
- [Improvement] Be aware of jobs retries HOT 1
- Status stay in retrying HOT 8
- Make job status table configurable
- undefined function config_path() HOT 1
- FatalErrorException, laravel worker can't start because of this package. HOT 1
- Undefined Query HOT 2
- Failed jobs not handled correctly HOT 1
- Use with Laravel-Excel's importing feature
- Beanstalk "Server reported NOT_FOUND" with exceptions
- JobStatus gets created and updated on different DB connections HOT 2
- SQLSTATE[42S22]: Column not found: 1054 Unknown column '0' in 'field list' (SQL: insert into `job_statuses` (`type`, `0`, `1`, `updated_at`, `created_at`) values (App\Jobs\Bill\MainSyncron, key, ibumAY9, 2021-02-28 16:52:37, 2021-02-28 16:52:37)) HOT 1
- ShouldBeUnique trait is ignored when generating status rows in database
- Too many queries
- Sending Mail job stays queued status
- When Job is Withoutoverlapping status is "finished" HOT 1
- Track batch jobs
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from laravel-job-status.