pampa 2.0.16 → 2.0.17
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 +4 -4
- data/lib/pampa.rb +10 -4
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fbbd19e65301b23d9e1ce78458528c5bdeecb73f2d54047e2546df8ad54f229d
|
4
|
+
data.tar.gz: aaea0b4f3b174b565cec083ff833c52b255aede1304757a2383f23057ea25f06
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 26472faf3ef44736e06ea39351fcc4380c7ba94f282051df49f12d2572190daca659603866f6a4275dc793b1408c992fa20310500ae74d28f283d6d75eac97ee
|
7
|
+
data.tar.gz: 7893ba252991c1e5603b00372d5a719552a3134fdd1daed6ed168c28c9f6864ed8d36561fe531f8ffef11557c099f9340c14b8411177b96f6714e10c9f498250
|
data/lib/pampa.rb
CHANGED
@@ -805,19 +805,25 @@ module BlackStack
|
|
805
805
|
end
|
806
806
|
end
|
807
807
|
|
808
|
+
def update(o)
|
809
|
+
DB[self.table.to_sym].where(
|
810
|
+
self.field_primary_key.to_sym => o[self.field_primary_key.to_sym]
|
811
|
+
).update(o)
|
812
|
+
end
|
813
|
+
|
808
814
|
def relaunch(o)
|
809
815
|
o[self.field_id.to_sym] = nil
|
810
816
|
o[self.field_time.to_sym] = nil
|
811
817
|
o[self.field_start_time.to_sym] = nil if !self.field_start_time.nil?
|
812
818
|
o[self.field_end_time.to_sym] = nil if !self.field_end_time.nil?
|
813
|
-
o
|
819
|
+
self.update(o)
|
814
820
|
end
|
815
821
|
|
816
822
|
def start(o)
|
817
823
|
if self.starter_function.nil?
|
818
824
|
o[self.field_start_time.to_sym] = DB["SELECT CAST('#{BlackStack::Pampa.now}' AS TIMESTAMP) AS dt"].first[:dt] if !self.field_start_time.nil? # IMPORTANT: use DB location to get current time.
|
819
825
|
o[self.field_times.to_sym] = o[self.field_times.to_sym].to_i + 1
|
820
|
-
o
|
826
|
+
self.update(o)
|
821
827
|
else
|
822
828
|
self.starter_function.call(o, self)
|
823
829
|
end
|
@@ -828,7 +834,7 @@ module BlackStack
|
|
828
834
|
o[self.field_end_time.to_sym] = DB["SELECT CAST('#{BlackStack::Pampa.now}' AS TIMESTAMP) AS dt"].first[:dt] if !self.field_end_time.nil? && e.nil? # IMPORTANT: use DB location to get current time.
|
829
835
|
o[self.field_success.to_sym] = e.nil?
|
830
836
|
o[self.field_error_description.to_sym] = e.to_console if !e.nil?
|
831
|
-
o
|
837
|
+
self.update(o)
|
832
838
|
else
|
833
839
|
self.finisher_function.call(o, e, self)
|
834
840
|
end
|
@@ -866,7 +872,7 @@ module BlackStack
|
|
866
872
|
o[self.field_time.to_sym] = DB["SELECT CAST('#{BlackStack::Pampa.now}' AS TIMESTAMP) AS dt"].first[:dt] # IMPORTANT: use DB location to get current time.
|
867
873
|
o[self.field_start_time.to_sym] = nil if !self.field_start_time.nil?
|
868
874
|
o[self.field_end_time.to_sym] = nil if !self.field_end_time.nil?
|
869
|
-
o
|
875
|
+
self.update(o)
|
870
876
|
# release resources
|
871
877
|
DB.disconnect
|
872
878
|
GC.start
|