Skip to content

Job Batching - #16

Merged
duncanmcclean merged 25 commits into
mainfrom
job-batches
Oct 30, 2024
Merged

duncanmcclean merged 25 commits into
mainfrom
job-batches

Conversation

@duncanmcclean

@duncanmcclean duncanmcclean commented Oct 29, 2024 •

Copy link
Copy Markdown
Member

This pull request implements Laravel's job batching feature, allowing us to group together all the jobs for a single import and determine if an import has been completed or not.

While these changes don't introduce any kind of progress indicator, it will make that easier in the future if we decide to add it.

Job batching does require a database in order to store information about the batches (like whether all the jobs have completed, the total number of jobs in a batch, etc). Since all new Statamic sites use SQLite by default, no additional configuration is required.

If you haven't already run the app's base migrations (which includes the job_batches table), the addon will attempt to run them automatically when you create an import.

If the migrations can't be run automatically, for whatever reason, a banner will be displayed on the import edit page:

CleanShot 2024-10-29 at 21 38 50

@duncanmcclean
duncanmcclean marked this pull request as ready for review October 30, 2024 13:07
@duncanmcclean
duncanmcclean merged commit ad70261 into main Oct 30, 2024
@duncanmcclean
duncanmcclean deleted the job-batches branch October 30, 2024 13:08
duncanmcclean added a commit that referenced this pull request Dec 9, 2024
The requirement for a SQLite database was added in #16. 

Even with it trying to automate the setup process for projects without an existing database, there are still some edge cases where you need to know it exists. 🫠

Related: #55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant