Comments (6)
@naserca Ultimately, I opted for a centralized change to Job.to_map/1
to handle this consistently across all engines. Now all job changesets are validated during insert_all
, and it's not possible to mistakenly insert an invalid changeset.
Note that previously sending a value like max_attempts: 0
, priority: -1
, queue: ""
, etc. would have raised a Postgrex error rather than an Ecto error. Yes, this may raise in some unexpected situations, but it's more consistent than before.
from oban.
@naserca The recorded: true
segment is missing because the job was invalid, and new/2
applies features in stages. Since the structured
stage returned an error, the recorded
stage didn't run.
The lack of validation during insert_all
is a problem that stems from mimicking how Repo.insert_all
behaves. We can't change the default behaviour because it would be a breaking change, but we can add an option to Oban.insert_all/3
to force validation. WDYT?
from oban.
I think the insert_all
naming (and functionality) while the actual arg is (at least in most cases) a single %Oban.Pro.Workers.Workflow{}
struct (and not a bare list of entries as Repo.insert_all
expects) might cause confusion and could benefit from something like Oban.insert_workflow
or even reusing Oban.insert
and Oban.insert!
. Curious what you think!
from oban.
Oban is isolated and unaware that Pro exists. We can't add Pro-specific functions to the core Oban module, and Elixir doesn't allow monkey patching (thankfully). Adding an insert_all!/3
variant is a potential alternative.
from oban.
insert_all!
seems reasonable! similarly my other suggestions were attempts to avoid "use this function but you have to add this option to avoid a bug" in favor of just "use this completely different function."
from oban.
thanks @sorentwo! makes sense.
from oban.
Related Issues (20)
- allow phoenix_html 4.0 in oban_web HOT 1
- Selecting jobs in Oban Web UI throws exception HOT 8
- Behaviour check in config validation fails with non-standard Repo module HOT 3
- Introduce global timeouts for workflows HOT 2
- Queue allowlist/denylist support for Lifeline Plugin HOT 1
- Oban Pro v1.3.1 Workflows jobs not moving to executing state HOT 16
- Oban with postgres fails when elixir time_zone_database is set to Tzdata.TimeZoneDatabase HOT 1
- Oban.Pro.Workers.Batch not executing callbacks when there is only one job in the batch HOT 1
- Potentially bug in handling DB errors in `Oban.Peers.Postgres` HOT 2
- Seeing High CPU Usage with Oban Table Partitioned HOT 12
- Overriding Worker.new results in a compilation warning HOT 2
- Oban Pro: jobs get stuck in executing and become orphans HOT 20
- Structs cannot be passed to Job.new HOT 3
- Notifier logs after upgrading to 2.17.4 HOT 18
- Upgrading to Oban 2.17.4 from 2.17.3 fails compilation step with `no function clause matching in Ecto.Query.with_cte/3 ` HOT 1
- Oban 2.17.4 update MATERIALIZED syntax error HOT 3
- Oban Web is refreshing the page constantly HOT 1
- Unclear docs for `perform/1` callback in case of an unhandled exception, exit or throw HOT 1
- Crontab information in Oban jobs (or job-related Telemetry events) HOT 7
- Potential bug: available jobs not being run HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from oban.