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

Optional update_job callback in Quantum.Storage #467

Merged
merged 1 commit into from
Nov 30, 2020

Conversation

pnezis
Copy link
Contributor

@pnezis pnezis commented Nov 30, 2020

Add an optional update_job callback in Quantum.Storage. If this is implemented then it will be called when a job gets updated, otherwise the previous behaviour (delete and then add the job) will be used.

Rationale: I have created a postgres storage and the jobs are linked to other tables through foreign keys. With the current implementation every time a job is updated it deletes the current job and adds it again. I want to be able to just update the properties that have changed and leave everything else untouched.

If the callback is overriden then it will be called, otherwise the
previous behaviour (delete and then add the job) is used.
@maennchen
Copy link
Member

Thanks a lot. ❤️ I'll merge when the CI passed.

@coveralls
Copy link

coveralls commented Nov 30, 2020

Pull Request Test Coverage Report for Build 46a44c435babfa68866a30eae98989dc53cab0a4-PR-467

  • 10 of 10 (100.0%) changed or added relevant lines in 2 files are covered.
  • 28 unchanged lines in 4 files lost coverage.
  • Overall coverage decreased (-8.02%) to 78.83%

Files with Coverage Reduction New Missed Lines %
lib/quantum/date_library.ex 1 55.0%
test/support/test_storage.ex 1 89.47%
lib/quantum/executor.ex 2 90.91%
lib/quantum/execution_broadcaster.ex 24 41.38%
Totals Coverage Status
Change from base Build 02e519fe0710b7c64a34762e3d3034d3ffb61aef: -8.02%
Covered Lines: 283
Relevant Lines: 359

💛 - Coveralls

@pnezis
Copy link
Contributor Author

pnezis commented Nov 30, 2020

@maennchen Please have a look at the tests issue I opened. I had to disable the tests locally in order to properly test the changes.

@maennchen
Copy link
Member

@pnezis Do you have time to have a look by yourself and open a PR as well? I don't have time at the moment and it may take some time until I can look at it.

@maennchen maennchen merged commit 5c3e4a2 into quantum-elixir:master Nov 30, 2020
@pnezis
Copy link
Contributor Author

pnezis commented Nov 30, 2020

@maennchen Here you are #468

@rogeriochaves
Copy link

hey @pnezis, could you share your postgres storage implementation?

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.

4 participants