trogdir_models 0.7.6 → 0.8.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/trogdir/syncinator.rb +23 -0
- data/lib/trogdir_models/version.rb +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: bb7232919839c14372e60517fad0eb183e7a5b33
|
4
|
+
data.tar.gz: 03cfa3dd0b4b16cd84e3344e820ceb511642cfde
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5536d8cc505c3a2992275ab24beb1a3c4c217f979938f1a3c37e01a0542d79b59aeb7d3a7e1203dfe77ee8d3b7e1e905b150ad406622919403d3e53b118d0c85
|
7
|
+
data.tar.gz: fb3a8b1ec4c689129b928a00ff5ce8ee6c111cf3bd84fceb1e8486dadf8e0eb3ea107c4f9f86e9c73514947de4229fcac79f26adbf3f67eb5904050567024997
|
data/lib/trogdir/syncinator.rb
CHANGED
@@ -23,12 +23,35 @@ class Syncinator
|
|
23
23
|
name
|
24
24
|
end
|
25
25
|
|
26
|
+
def changesets
|
27
|
+
Changeset.where('change_syncs.syncinator_id' => id).order_by(created_at: :asc)
|
28
|
+
end
|
29
|
+
|
26
30
|
def unfinished_changesets
|
27
31
|
Changeset.where(
|
28
32
|
:change_syncs.elem_match => {syncinator_id: id, :run_after.ne => nil}
|
29
33
|
).order_by(created_at: :asc)
|
30
34
|
end
|
31
35
|
|
36
|
+
# have started but haven't errored or succeeded
|
37
|
+
def pending_changesets
|
38
|
+
Changeset.where(
|
39
|
+
:change_syncs.elem_match => {
|
40
|
+
syncinator_id: id, :run_after.ne => nil, :sync_logs.elem_match => {
|
41
|
+
:started_at.ne => nil, errored_at: nil, succeeded_at: nil
|
42
|
+
}
|
43
|
+
}
|
44
|
+
).order_by(created_at: :asc)
|
45
|
+
end
|
46
|
+
|
47
|
+
def errored_changesets
|
48
|
+
Changeset.where(
|
49
|
+
:change_syncs.elem_match => {
|
50
|
+
syncinator_id: id, :run_after.ne => nil, :'sync_logs.errored_at'.exists => true
|
51
|
+
}
|
52
|
+
).order_by(created_at: :asc)
|
53
|
+
end
|
54
|
+
|
32
55
|
def startable_changesets
|
33
56
|
Changeset.where(
|
34
57
|
:change_syncs.elem_match => {syncinator_id: id, :run_after.lt => Time.now }
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: trogdir_models
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.8.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Adam Crownoble
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-11-
|
11
|
+
date: 2014-11-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: api-auth
|