herdst_worker 0.1.9 → 0.1.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: e394fc18334aecfcbb21d5c9e639067a1f777b2d137edd9fb404bc6c86722613
4
- data.tar.gz: ed79d59376596ec7f57d753d9c87f5ed939362834fdbde91a84392857f304a65
3
+ metadata.gz: de1696f26e425f21b3b7b012d121e1b26ea963ebcf8af1c8f8a9c13139aeca1c
4
+ data.tar.gz: df244986263a10dbe81226d4460dbea2347291ceead2271615482dae8cfb3616
5
5
  SHA512:
6
- metadata.gz: 8e4f9442a39b0d8b0e14ce93c14963ce7ca9297e054a9df5d66e0a1e335de543731ccef5b8fd41939efa74907ca7c1167bb3b60ed65404d7c6f497da84ca7739
7
- data.tar.gz: 49e2e8e2e01b3fcebf58b48f253cf763f59b18013b560aabe80f719ed2f52b0594494f9809e2e3c0bb3429ba71644622b9c04632cd90fc4118a55219bffaace5
6
+ metadata.gz: bfe4d82d6ccd9c9d2c4f6d0ba525e5a390efe99f6c4195a4f024f94f14f8d9528f95d762194d811048cd9b3dedd8949e519fbb5c385a9e787cc9f8dfc3967bee
7
+ data.tar.gz: 0f455004efd2140e80884dea4287fe235b41112d9a6b7e072373f6538e9becbf1b8b50165bc59062a75d90994de0ff7a00f5a710e485f84b5da98f0013c0737f
@@ -4,18 +4,19 @@ module HerdstWorker
4
4
 
5
5
 
6
6
  def self.setup(app)
7
+ ActiveRecord::Base.default_timezone = :utc
8
+
7
9
  begin
10
+ if app.config.is_dev?
11
+ ActiveRecord::Base.logger = app.logger.activerecord
12
+ end
13
+
8
14
  db_config = app.config_for(:database)
9
15
  db_config.each do |k, v|
10
16
  db_config[k] = ActiveRecord::DatabaseConfigurations::HashConfig.new(app.config.env, k, v)
11
17
  end
12
-
13
- if app.config.is_dev?
14
- ActiveRecord::Base.logger = app.logger.activerecord
15
- end
16
18
 
17
19
  ActiveRecord::Base.configurations = db_config.values
18
- ActiveRecord::Base.default_timezone = :utc
19
20
  ActiveRecord::Base.establish_connection(db_config[:primary])
20
21
  ActiveRecord::Base.connection.enable_query_cache!
21
22
  rescue Exception => ex
@@ -60,7 +60,7 @@ module HerdstWorker
60
60
  data_source = record["eventSource"].split(":")
61
61
  data_origin = data_source.first
62
62
  data_operation = data_source.last
63
- record_data = record[data_operation]
63
+ record_data = record[data_operation]
64
64
  company_id = nil
65
65
  user_id = nil
66
66
 
@@ -68,6 +68,11 @@ module HerdstWorker
68
68
  record_data["sentTimestamp"] = sent_timestamp
69
69
  record_data["triggerTimestamp"] = trigger_timestamp || sent_timestamp
70
70
 
71
+ # Id the event origin is s3 and an object was created overwrite the configuration ID
72
+ if data_origin == "aws" && data_operation == "s3" && record["eventName"] == "ObjectCreated:Put"
73
+ record_data["configurationId"] = "objectCreated"
74
+ end
75
+
71
76
  execution_data << record_data
72
77
 
73
78
  if data_origin === "application" and record.include? "userIdentity"
@@ -121,14 +126,7 @@ module HerdstWorker
121
126
 
122
127
  protected
123
128
  def fail_action_permanently(data)
124
- if data.include? "action_id"
125
- # action = Action.get(data["action_id"])
126
- #
127
- # if action
128
- # action.update_data({ :stats => nil, :errors => nil }, :errored)
129
- # action.cleanup
130
- # end
131
- end
129
+
132
130
  end
133
131
 
134
132
 
@@ -1,3 +1,3 @@
1
1
  module HerdstWorker
2
- VERSION = '0.1.9'
2
+ VERSION = '0.1.12'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: herdst_worker
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.9
4
+ version: 0.1.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - Herd.St
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-04-05 00:00:00.000000000 Z
11
+ date: 2022-05-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport