Comments (1)
Hi there @jobh
Could you share more context to help us understand the test-case a bit. For example, do you have any jobs in the queue?
The way timeout works changed in 362681e and the goal there is to dynamically pick a shorter timeout if there's a scheduled job. In what case, the pq would skip timeouts if there's immediate work to do.
Now looking at your example:
q.get(timeout=0)
Will always default to the default timeout, since
>>> 0 or 1
1
So, this should be either fixed by checking for None
s or document that 0 is an invalid timeout. The call timeout, also sets the new queue instance timeout, which is probably the confusing part.
Let me know if this answers your questions, or please ask away anything that you don't find clear. I'll be happy to help.
In the meantime, let's wait on merging #55 until we discuss exactly what's the goal with this issue and the PR itself.
You might be interested in taking a look at the query that actually returns the dynamic timeout value:
https://github.com/malthe/pq/blob/master/pq/__init__.py#L327-L329
from pq.
Related Issues (20)
- connection pool exhausted HOT 3
- DuplicatePreparedStatement error HOT 10
- Prepared statement name not properly escaped HOT 1
- Question: why am I seeing "NOTICE: function pq_notify does not exist" in the logs? HOT 3
- Delete executed tasks?! HOT 1
- Wait on a job? HOT 3
- Any interest in porting to cockroach HOT 3
- Pipenv using old create.sql HOT 5
- Get id of current task HOT 2
- Performance with a very large queue HOT 9
- lost trigger when setting up multiple queue-tables within the same schema
- Adding recurring tasks? HOT 4
- queue.put() inside a transaction sets enqueued_at to the transaction start time, not the current time HOT 4
- Adding name of the job producer HOT 2
- Dashboard for PQ HOT 3
- Any plans to migrate to Psycopg 3? HOT 1
- get items sometimes doesn't work
- 2.x roadmap
- Logging message not explicit
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 pq.