operationable 0.3.0 → 0.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 87e1e8d542b6b207ed3189bb0c75221a0d36511c
4
- data.tar.gz: 486232650b057a3d541bbecf2768375ce9987e28
3
+ metadata.gz: dda1a088a4f86bd2c423a35b629bec4ace91cc01
4
+ data.tar.gz: 70fdcb19c888dd5fcc19165d068e06907b341ee5
5
5
  SHA512:
6
- metadata.gz: 199c43f18a8d2710be243450544e640b12be0c0841cbeeb8af015a71eaf1858a4afe880c91f15f277eb344d442aa962c4cba60ef7d9d5ed6ed0a09cd6c34ab03
7
- data.tar.gz: a0ec714a500f3e4dab37704edd1fafcfad723fe8933c341cb3dfcddf81ee2772b20969f48682641a5f2181254b829b4ecf3a494fdc89080ff171d848a7cd4b22
6
+ metadata.gz: e15a0b221702498945f2a0eca3f852b97fdc9e3660df544842ba007dc985dbe1bbbe16df8cd54d52d1ae5732bd94038b9b1afed046466b8deb110c4fabb264dd
7
+ data.tar.gz: 4468c4c3c754aac78032b09b89fd1f544e668a741b9adc93cfe306492dc92f548d2a69cc758110b25ebe725544faa8ae779fbe42d132c000f81c787646b81665
@@ -71,7 +71,7 @@ module Operationable
71
71
  end
72
72
 
73
73
  def working
74
- set_status({'status' => Operationable::Persisters::Base::STATUS_WORKING})
74
+ set_status({'status' => Operationable::Persisters::Base::STATUS_WORKING, attempts: 1})
75
75
  end
76
76
 
77
77
  # set the status to 'failed' passing along any additional messages
@@ -3,8 +3,15 @@ module Operationable
3
3
  module Persisters
4
4
  module Database
5
5
  def self.create(q_options, props)
6
+ date = Time.zone.now.to_date
7
+
6
8
  ::OperationCallback.create(
7
- q_options: q_options, props: props, status: Operationable::Persisters::Base::STATUS_INIT
9
+ q_options: q_options,
10
+ props: props,
11
+ attempts: 0,
12
+ week: props[:week] || date.cweek,
13
+ year: props[:year] || date.year,
14
+ status: Operationable::Persisters::Base::STATUS_INIT
8
15
  )
9
16
  end
10
17
 
@@ -16,7 +16,7 @@ module Operationable
16
16
 
17
17
  def store_callback(q_options)
18
18
  op_cb = ::Operationable::Persisters::Database.create(q_options, props)
19
- q_options.merge({op_cb_id: op_cb.id})
19
+ q_options.merge({op_cb_id: op_cb.id})
20
20
  end
21
21
 
22
22
  def persist_operation
@@ -47,7 +47,7 @@ module Operationable
47
47
  end
48
48
 
49
49
  def job_sync_execute_method
50
- :perform_now
50
+ :perform_later
51
51
  end
52
52
 
53
53
  def job_async_execute_method
@@ -1,3 +1,3 @@
1
1
  module Operationable
2
- VERSION = "0.3.0"
2
+ VERSION = "0.3.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: operationable
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kirill Suhodolov