Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add job queue system to generate books #489

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .env
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ APP_SECRET=2a025c1d3afd0715b3b86562f327b7a0
DATABASE_URL=mysql://db_user:[email protected]:3306/db_name?serverVersion=5.7
###< doctrine/doctrine-bundle ###

MESSENGER_TRANSPORT_DSN=doctrine://wsexport

###> symfony/mailer ###
MAILER_DSN=smtp://mail.tools.wmflabs.org:25
###< symfony/mailer ###
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ jobs:
run: |
composer install
./bin/console doctrine:migrations:migrate --no-interaction
./bin/console messenger:setup-transports
npm ci

- name: Test
Expand Down
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
"symfony/dotenv": "5.4.*",
"symfony/framework-bundle": "5.4.*",
"symfony/mailer": "5.4.*",
"symfony/messenger": "^5.4",
"symfony/monolog-bundle": "^3.6",
"symfony/process": "5.4.*",
"symfony/stopwatch": "5.4.*",
Expand Down
301 changes: 300 additions & 1 deletion composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 14 additions & 0 deletions config/packages/messenger.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
framework:
messenger:

failure_transport: failed

transports:
async:
dsn: "%env(MESSENGER_TRANSPORT_DSN)%"
retry_strategy:
max_retries: 0
failed: "%env(MESSENGER_TRANSPORT_DSN)%?queue_name=failed"

routing:
'App\Message\CreateBookMessage': async
7 changes: 7 additions & 0 deletions config/packages/test/messenger.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
framework:
messenger:
transports:
async: "sync://"
failed: "sync://"
# routing:
# 'App\Message\CreateBookMessage': async
1 change: 1 addition & 0 deletions i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@
"onwikiconfig-failure": "Unable to retrieve the on-wiki configuration from: $1",
"exception-fetching-credits": "Error fetching credits information. Please try exporting again. If this error persists, check the box in 'Options' to remove credits.",
"exception-book-conversion": "Error converting the format of the book.",
"exception-no-file-generated": "The book was not generated within $1 seconds.",
"epub-title-page": "Title page",
"epub-exported-date": "Exported from Wikisource on $1",
"epub-about": "About"
Expand Down
1 change: 1 addition & 0 deletions i18n/qqq.json
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@
"onwikiconfig-failure": "Error message displayed if the on-wiki configuration fetching failed.\n\n* $1 - the URL of the config JSON page on Wikisource.",
"exception-fetching-credits": "Error message displayed when credits information could not be retrieved.",
"exception-book-conversion": "Error message displayed when a book could not be converted to another format.",
"exception-no-file-generated": "Error message displayed if the job queue takes too long to generate a book.\n\nParameters:\n\n* $1 — integer number of seconds that it took to not generate the book.",
"epub-title-page": "Name of the title page in exported books (used in the table of contents).",
"epub-exported-date": "Phrase used on the title page to indicate the book export date.\n\n$1 - the localized date.",
"epub-about": "Name of the 'about' page in exported books (used in the table of contents)."
Expand Down
Loading