Skip to content

Conversation

@guewen
Copy link
Member

@guewen guewen commented Oct 24, 2022

legalsylvain and others added 17 commits October 24, 2022 09:50
These fields should not be changed by users.
Several fields on queue.job are initialized using computed fields,
then never changed again. On creation of a queue.job record, we'll have
an initial INSERT + at least one following UPDATE for the computed
fields.

Replace all the stored computed fields by a raw initialization of the
values in `Job.store()` when the job is created, so we have only a
single INSERT.

Highlights:

* as channel is no longer a compute/inverse field, override_channel is
  useless, I dropped it (actually the same value was stored in both
  channel and override_channel as the channel field was stored)
* one functional diff is that now, when changing a channel on a
  job.function, the channel is no longer synchronized on existing jobs,
  it will be applied only on new jobs: actually this is an improvement,
  because it was impossible to change the channel of a job function
  in a large queue_job table as it meant writing on all the done/started
  jobs
* searching the queue.job.function is now cached, as each job using the
  same will run a query on queue_job_function
Everytime a job is created, a mail.message "Queue Job created" is
created. This is useless, as we already have the creation date and user,
and nobody will ever want to receive a notification for a created job
anyway.

Removing the on creation auto-subscription of the user that created the
job makes sense as well since we automatically subscribe the queue job
managers for failures. Add the owner of the jobs to the followers on
failures only as well.

It allows to remove a lot of insertions of records (and of deletions
when autovacuuming jobs).
When RetryableJobError was raised, any change done by the job was not
rollbacked.

Using `raise` would throw the exception up to the core and rollback, but
we would have a stack trace in the logs for each try. Calling rollback
manually (rollback also clears the env) hide the tracebacks, however,
when the last try fails, the full traceback is still shown in the logs.

Fixes OCA#261
When Job.date_done has been set, for instance because the job has been
performed, if the job is set back to pending (e.g. a RetryableJobError
is raised), the date_done is kept.
The float_time widget shows hours seconds, we only want seconds.
The widget had been removed on the form view, but not on the tree view.
@guewen guewen marked this pull request as ready for review October 24, 2022 14:57
hbrunn and others added 5 commits October 24, 2022 17:15
Use case:

* you have a root channel per scope/app (eg: root.edi)
* you have several sub channels (eg: root.edi.ubl.sales,
root.edi.gs1.delivery)
* you want to configure capacity only for the main channel "root.edi"

Before this change, the channel manager falls back on root channel.
However, if you have a specific parent channel configured
it sounds a good idea to use it.
Contributing since a while... :)
@guewen guewen force-pushed the oca-port-pr-392-from-14.0-to-15.0 branch from 13cee61 to e282ef0 Compare October 24, 2022 15:30
@OCA-git-bot
Copy link
Contributor

This PR has the approved label and has been created more than 5 days ago. It should therefore be ready to merge by a maintainer (or a PSC member if the concerned addon has no declared maintainer). 🤖

@hbrunn
Copy link
Member

hbrunn commented Oct 31, 2022

/ocabot merge nobump

@OCA-git-bot
Copy link
Contributor

On my way to merge this fine PR!
Prepared branch 15.0-ocabot-merge-pr-475-by-hbrunn-bump-nobump, awaiting test results.

@OCA-git-bot OCA-git-bot merged commit 8008f0b into OCA:15.0 Oct 31, 2022
@OCA-git-bot
Copy link
Contributor

Congratulations, your PR was merged at 8fcd8b0. Thanks a lot for contributing to OCA. ❤️

lmignon added a commit to acsone/queue that referenced this pull request Nov 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants