apidae 1.3.11 → 1.3.12

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: bee9036918ecb7ac147dca2b69a63f0604f0bde51cdfaa3f873f7b4d186aec1f
4
- data.tar.gz: 6f7334fedf936fbfa88714f4d94b930d855299661fc9c6c2f0b2dd312cc5609f
3
+ metadata.gz: da5768b591408dcf9f2fdadd5ab979b69ef1fcdb0de84c3a9c9eccb5ca11f744
4
+ data.tar.gz: 4fca91b7f71cc833947426fcd31390c8f94bf7bdff8d196cc176f9bf37c64cf5
5
5
  SHA512:
6
- metadata.gz: d6d7c79ee27939c1263092dcad1dfe786ea0cf2a69af8d02ef408336076c7527d56fad0b8954dac5c674e3f2a837b1af6ca79996a437fdbb06fb6391340413f1
7
- data.tar.gz: 45ef9cd81e5bc646a103536488410dbec175cc75b7272ddd5a3ddf97ee7f265af1c807df2b120140c40edd505abdafc9a1ae387dcafcbb8e764afa3c781d71d5
6
+ metadata.gz: a980dbfb064064fed555cf9f6a58a73ae25d44c1c41b604a0a5afaad67982d3cf58468e2816079ff4d2a158c0c50c3920ac463df538146cf388499eb97c1058a
7
+ data.tar.gz: efb3d85c63fe98fdc066d3f9b73fcbe2c9c058d0669fc579324c874cdac1b6eeb07e4aadb2bc265904b8878a3004a32c6c6bec6703374edefc4eed990d4c7958
@@ -37,6 +37,7 @@ module Apidae
37
37
  def run
38
38
  success = true
39
39
  Export.pending.each do |e|
40
+ e.update(status: Export::IN_PROGRESS)
40
41
  success &&= e.import_data
41
42
  end
42
43
  success ? head(:ok) : head(:internal_server_error)
@@ -375,7 +375,6 @@ module Apidae
375
375
  else
376
376
  nil
377
377
  end
378
-
379
378
  end
380
379
 
381
380
  private
@@ -5,6 +5,7 @@ module Apidae
5
5
  class Export < ActiveRecord::Base
6
6
 
7
7
  PENDING = 'pending'
8
+ IN_PROGRESS = 'in_progress'
8
9
  COMPLETE = 'complete'
9
10
  CANCELLED = 'cancelled'
10
11
 
@@ -24,6 +25,10 @@ module Apidae
24
25
  where(remote_status: 'SUCCESS', status: PENDING).order(:id)
25
26
  end
26
27
 
28
+ def self.in_progress
29
+ where(remote_status: 'SUCCESS', status: IN_PROGRESS)
30
+ end
31
+
27
32
  def import_data
28
33
  success = true
29
34
  begin
@@ -1,3 +1,3 @@
1
1
  module Apidae
2
- VERSION = "1.3.11"
2
+ VERSION = "1.3.12"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: apidae
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.11
4
+ version: 1.3.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jean-Baptiste Vilain
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-06-02 00:00:00.000000000 Z
11
+ date: 2022-06-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails