Comments (2)
You're correct; the tests are generating an invalid query. There's not much of a reason to assert the scheduled time for something currently available
, but I think we can still make it work.
from oban.
So I've found out that using both state
and scheduled_at
options forces assert_enqueued/2
to generate the following query:
#Ecto.Query<from j0 in Oban.Job, where: j0.state in ["available", "scheduled"],
where: fragment(
"? BETWEEN ? AND ?",
j0.scheduled_at,
^~U[2023-03-22 21:36:32.819404Z],
^~U[2023-03-22 21:36:42.819404Z]
),
where: j0.state == ^"scheduled", where: j0.worker == ^"Worker",
order_by: [desc: j0.id]>
with an invalid condition state == ^"scheduled"
. This happens because assert_enqueued/2
builds a Job changeset to process/normalize opts
, which in turn would set the scheduled
state if opts
contain :scheduled_at
, effectively overriding the state
value given in opts
.
from oban.
Related Issues (20)
- Incompatibility with Ecto 3.10.1 HOT 5
- Add first-class support for reliable execution guarantees to DynamicCron HOT 5
- Allow configuration for default priority HOT 4
- Oban.Migration queries do not emit `schema_migration: true` in telemetry metadata HOT 6
- SmartEngine: Don't fetch jobs that have reached max attempts HOT 1
- Oban.Pro.Queue.SmartEngine doesn't put oban telemetry metadata HOT 1
- Minor documentation clarification for Oban.Worker and Oban.Pro.Worker HOT 1
- KeyError key :limit not found HOT 2
- Support LiveView v0.19.x HOT 2
- Invalid jobs are gracefully inserted but corrupted upon Oban.insert_all of a workflow HOT 6
- Scope leadership to a particular context or plugin HOT 1
- API for fetching children jobs in Workflow Worker HOT 2
- Add test helpers similar to assert_raise HOT 3
- Oban.Telemetry docs don't reflect reality HOT 3
- retry_all_jobs/1 retrying successfully completed jobs HOT 1
- Check period for given timestamp while checking for uniqueness HOT 6
- Error log `no function clause matching` during server shutdown HOT 1
- Scheduling strategy for upholding Slack postMessage limits HOT 1
- Missing unique constraint on `oban_peers` table HOT 6
- Replace job state on conflict HOT 1
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.