39 Commits

Author SHA1 Message Date
Alexander Brandon Coles 03572f4444 Freeze string literals in app/workers
rubocop -A --only Style/FrozenStringLiteralComment,Layout/EmptyLineAfterMagicComment,Style/RedundantFreeze app/workers
2025-07-18 17:42:42 +01:00
Ivan Kuchin 4d0d2a94eb empty Projects::Phases::ApplyWorkingDaysChangeJob 2025-06-04 18:33:20 +02:00
Oliver Günther fbb54ba6f7 Ensure mailer jobs also have a priority 2025-01-28 12:46:19 +01:00
Christophe Bliard 49a74827ff [57932] Keep retrying mailer jobs for 1.5 days
https://community.openproject.org/wp/57932

Retrying 14 times with polynomial backoff means it will retry for
roughly 1.5 days.

Previously the `retry_on StandardError` defined in the
`Mails::MailerJob` class was ignored because there is also a
`rescue_from StandardError` declared after it. As `retry_on` is
implemented using `rescue_from`, and the handlers are evaluated in
reverse order, the last declared `rescue_from` would be picked up and
the retry logic would not be triggered. That's why mail jobs were
discarded instead of being retried.

This commit fixes the issue by inheriting directly from
`ActionMailer::MailDeliveryJob` instead of redefining its methods. This
was the `rescue_from` is declared first in the parent class, and then
`retry_on` is declared second in the child class, meaning it will take
precedence and be picked up.

The needed shared logic from `ApplicationJob` is extracted to a new
`SharedJobSetup` module and included in both `ApplicationJob` and
`Mails::MailerJob`.
2024-10-02 12:17:18 +02:00
Ivan Kuchin 4911b8a149 remove years from copyrights (except for COPYRIGHT file) 2024-07-31 15:02:49 +02:00
Ivan Kuchin fa5d03eae0 rubocop safe autocorrect all except Rails/WhereRange 2024-05-30 19:54:08 +02:00
ulferts 3b2121f733 Revert "Merge remote-tracking branch 'origin/release/13.4' into dev"
This reverts commit 40b2bbeb09, reversing
changes made to b4c6cb17cc.
2024-03-21 11:31:17 +01:00
Ivan Kuchin 7787e457a3 Revert "Merge branch 'dev' into release/13.4"
This reverts commit a901541269, reversing
changes made to e573ca00b7.
2024-03-20 20:19:08 +01:00
Ivan Kuchin 9e4934cd0a change quotes using rubocop --only Style/StringLiterals,Style/QuotedSymbols -a 2024-03-20 18:05:22 +01:00
Oliver Günther 337eda7dfa Revert "Revert "Merge pull request #12998 from opf/task/48717-replace-delayedjob""
This reverts commit dfa75621ea.
2024-03-07 13:59:24 +01:00
Markus Kahl dfa75621ea Revert "Merge pull request #12998 from opf/task/48717-replace-delayedjob"
This reverts commit 9f3e4c48ea, reversing
changes made to 10412f7c85.
2024-03-07 12:40:15 +00:00
Pavel Balashou 2267a0a1e3 React on comments from review.
- Do not use string literals for job class names. Use `class.name` instead.
- Rename `ApplicationJob#good_job_scheduled_at` to `ApplicationJob#job_scheduled_at` to be backend agnostic.
- update queries in bin/check-worker-liveness to use good_jobs table
- Set good_job config options through appropriate OpenProject::Configuration
- Remove delayed_jobs table.
- Update health_check docs.
2024-02-27 22:35:33 +01:00
Pavel Balashou fd6a899b29 [#48717] Replace DelayedJob with GoodJob.
https://community.openproject.org/work_packages/48717
2024-02-14 10:18:27 +01:00
Christophe Bliard 8fa8584538 Run rubocop --autocorrect on all files
Only the safe cops have run. rubocop version is 1.59.0.
2024-01-05 15:27:09 +01:00
Christophe Bliard c795874f7f Update copyright year for 2024
command used: `rg -l 'Copyright \(C\) 2012-202\d the OpenProject' | xargs -n 100 sed -i -r 's/Copyright \(C\) 2012-202. the OpenProject/Copyright (C) 2012-2024 the OpenProject/'`
2024-01-02 16:23:54 +01:00
Christophe Bliard 9e865b4f7b lint: Run rubocop safe autocorrect
Command is `rubocop --safe --autocorrect app lib lib_static modules spec`
2023-03-09 10:25:57 +01:00
ulferts 4f079994f0 Merge branch 'release/12.4' into dev 2023-01-05 16:33:52 +01:00
Oliver Günther 10a13e326b Add appsignal tags to application job 2023-01-05 09:15:47 +01:00
Christophe Bliard 21a696ef9b Update copyright information for 2023 2022-12-30 15:51:26 +01:00
Oliver Günther 22b7849520 Remove legacy mailer configuration and move into settings
Split from "Remove Setting.protocol in favor of static config"

Restore cache store setup
2022-05-18 16:21:55 +02:00
Christophe Bliard bc8d423ec2 update copyright information for 2022 2022-03-01 17:05:59 +01:00
Markus Kahl f83f96a172 elevated prio for jobs users might wait for 2022-02-09 10:59:47 +01:00
ulferts 8ef6c1110c Merge branch 'release/11.3' into dev 2021-09-13 09:44:34 +02:00
Oliver Günther ccfa29c728 Move license and copyright docs to root, fix names and references 2021-09-02 21:50:46 +02:00
Markus Kahl 4ff17038f2 fix mailer config reload
It wasn't reloaded because
the SMTP settings were still cached in the
request store which only was reset afterwards
2021-09-01 12:40:58 +01:00
ulferts 6140f4c7e9 update copyright to 2021 (#8925)
Updates the copyright to 2021 for all files that have a copyright. Files in our source code without the copyright header still do not receive one automatically. Additionally, backlisted files are also excluded.

Previously the copyright of chiliproject which references redmine stated a copyright of redmine up to and including 2017 which is not true for the code we have in here. Because of that I changed that to 2013
2021-01-13 17:47:45 +01:00
Oliver Günther 0740070bca By default, do not log arguments to background jobs 2021-01-11 13:28:54 +01:00
Oliver Günther 58562e7379 Let CopyProjectJob redirect to the target project 2020-06-16 15:35:16 +02:00
Oliver Günther 7612e34964 Allow jobs to define to store status even without a reference 2020-06-12 09:01:13 +02:00
Oliver Günther c94c1951b9 [33413] Use around hook to reload config in jobs
https://community.openproject.com/wp/33413
2020-05-26 11:28:49 +02:00
ulferts 1e6c1e7d72 introduce a presisted status for delayed jobs (#8299)
This is currently only employed for work package export jobs but is
intended to be used more broadly, e.g. to signal the status of copying a
project.

[ci skip]
2020-04-23 07:37:25 +02:00
Henriette Dinger bd7f4e4814 Update copyright notice 2020-01-15 11:31:26 +01:00
Oliver Günther a7ed2e9da0 Rewrite jobs to use ActiveJob syntax 2019-10-25 09:09:45 +02:00
Oliver Günther 3aa3dea512 Allow deliver_later using a custom ApplicationJob
We're getting more and more reports on synchronous Timeouts and SMTP
errors causing internal errors for users when trying to send mail in the
request of the browser.

With rails 5.2, we can assign a custom job that handles the
`deliver_later` delayed sending. We can hook this into the
ApplicationJob with delayed_job.

Since rails now also has GlobalID serialization of ActiveRecord, we
don't even need to do the serialization ourselves!
2019-10-25 09:09:45 +02:00
Oliver Günther 2fc4416601 Store User.current in current thread 2019-07-11 10:34:13 +01:00
Oliver Günther f2ceec1c78 Set DJ priorities and lower max attempts 2018-09-03 15:58:16 +02:00
Oliver Günther 6ef4211e77 Bump copyright to 2018 (#6171)
[ci skip]
2018-02-12 08:51:12 +01:00
Oliver Günther 7cf11bb689 Update copyright notice 2017-01-10 15:11:43 +01:00
Markus Kahl 92506216d3 use common base class for jobs 2016-10-11 08:11:40 +02:00