que-web 0.6.2 → 0.6.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/que/web/sql.rb +17 -8
- data/que-web.gemspec +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d8584792cba68d7f6e00a6e4852a676fff5620cb
|
4
|
+
data.tar.gz: eab83486882b4aed634b029f532083c054a437c2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 199fd0f8f74f1860ad539575a15f5625f73c49dba9f43a873354395c08d2689cdcecac05d1c530da475eab95b5053bc85060d517c8f87b4e9d9fc1c2cafad0a9
|
7
|
+
data.tar.gz: 4bdbe7d0e610f7f55893132f11decbaa4fda2f2bcaafd3ec394680ba6e1473cb78fef0447ab29e8e11332b430250365fe3fd0f157de89bc76f51c59b7a10219d
|
data/lib/que/web/sql.rb
CHANGED
@@ -1,3 +1,9 @@
|
|
1
|
+
lock_job_sql = <<-SQL.freeze
|
2
|
+
SELECT job_id, pg_try_advisory_lock(job_id) AS locked
|
3
|
+
FROM que_jobs
|
4
|
+
WHERE job_id = $1::bigint
|
5
|
+
SQL
|
6
|
+
|
1
7
|
Que::Web::SQL = {
|
2
8
|
dashboard_stats: <<-SQL.freeze,
|
3
9
|
SELECT count(*) AS total,
|
@@ -40,18 +46,21 @@ Que::Web::SQL = {
|
|
40
46
|
OFFSET $2::int
|
41
47
|
SQL
|
42
48
|
delete_job: <<-SQL.freeze,
|
43
|
-
|
44
|
-
FROM que_jobs
|
45
|
-
|
46
|
-
|
47
|
-
|
49
|
+
WITH target AS (#{lock_job_sql})
|
50
|
+
DELETE FROM que_jobs
|
51
|
+
USING target
|
52
|
+
WHERE target.locked
|
53
|
+
AND target.job_id = que_jobs.job_id
|
54
|
+
RETURNING pg_advisory_unlock(target.job_id)
|
48
55
|
SQL
|
49
56
|
reschedule_job: <<-SQL.freeze,
|
57
|
+
WITH target AS (#{lock_job_sql})
|
50
58
|
UPDATE que_jobs
|
51
59
|
SET run_at = $2::timestamptz
|
52
|
-
|
53
|
-
|
54
|
-
|
60
|
+
FROM target
|
61
|
+
WHERE target.locked
|
62
|
+
AND target.job_id = que_jobs.job_id
|
63
|
+
RETURNING pg_advisory_unlock(target.job_id)
|
55
64
|
SQL
|
56
65
|
fetch_job: <<-SQL.freeze,
|
57
66
|
SELECT *
|
data/que-web.gemspec
CHANGED
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
4
4
|
|
5
5
|
Gem::Specification.new do |spec|
|
6
6
|
spec.name = "que-web"
|
7
|
-
spec.version = "0.6.
|
7
|
+
spec.version = "0.6.3"
|
8
8
|
spec.authors = ["Jason Staten"]
|
9
9
|
spec.email = ["jstaten07@gmail.com"]
|
10
10
|
spec.summary = %q{A web interface for the que queue}
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: que-web
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.
|
4
|
+
version: 0.6.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jason Staten
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-11-
|
11
|
+
date: 2017-11-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: que
|