summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorschneefux <schneefux+commit@schneefux.xyz>2017-03-12 15:02:18 +0100
committerschneefux <schneefux+commit@schneefux.xyz>2017-03-12 15:02:18 +0100
commitfe148d0187d273b80ac4ff7e45400fb442b6d3a6 (patch)
tree56c271c36f9bbec5fba80716f2914da10c7eb665
parente4896dc8e460ec5c1a32348e2137e19ac2c90d3a (diff)
downloadjoblib-fe148d0187d273b80ac4ff7e45400fb442b6d3a6.tar.gz
joblib-fe148d0187d273b80ac4ff7e45400fb442b6d3a6.zip
create an index on priority, id
-rw-r--r--joblib.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/joblib.py b/joblib.py
index 1b77b2e..8faf71f 100644
--- a/joblib.py
+++ b/joblib.py
@@ -40,6 +40,9 @@ class JobQueue(object):
payload JSONB
)
""")
+ await con.execute("""
+ CREATE UNIQUE INDEX ON jobs(priority, id)
+ """)
async def request(self, jobtype, payload, priority=0):
"""Create a new job and return its id."""