herdst_worker 0.1.3 → 0.1.4
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/herdst_worker/adapters/database.rb +22 -17
- data/lib/herdst_worker/adapters/sentry.rb +14 -10
- data/lib/herdst_worker/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c4db06011c97482874347cf7e1c3300a9be6c6e2f624e5d4e5b47583db671762
|
4
|
+
data.tar.gz: 5451e470825822eaa0387cef72c55a12d7b44c79ea829fef6a455f065932841c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5471195f87658b0b67125bfd648026d5bc36c82debc634f8b3424e72e7049877e375466c032aac6c4b14277c296c473f50979dd1e0b8a7fa31c7122f26aedd22
|
7
|
+
data.tar.gz: 6601e22494f9049c2133553e7af958d0e00979a07ca55f1ab0256981e942348b1ed5dc651dd1a41e4990062e69855f6c130a2bab466acac983b195e6ff9cffd4
|
@@ -4,25 +4,30 @@ module HerdstWorker
|
|
4
4
|
|
5
5
|
|
6
6
|
def self.setup(app)
|
7
|
-
db_config = app.config_for(:database)
|
8
7
|
|
9
|
-
|
10
|
-
|
8
|
+
begin
|
9
|
+
db_config = app.config_for(:database)
|
10
|
+
|
11
|
+
if app.config.is_dev?
|
12
|
+
ActiveRecord::Base.logger = app.logger.activerecord
|
13
|
+
end
|
14
|
+
|
15
|
+
ActiveRecord::Base.default_timezone = :utc
|
16
|
+
ActiveRecord::Base.establish_connection(
|
17
|
+
adapter: db_config[:adapter],
|
18
|
+
encoding: db_config[:encoding],
|
19
|
+
charset: db_config[:charset],
|
20
|
+
collation: db_config[:collation],
|
21
|
+
pool: db_config[:pool],
|
22
|
+
host: db_config[:host],
|
23
|
+
username: db_config[:username],
|
24
|
+
password: db_config[:password],
|
25
|
+
database: db_config[:database]
|
26
|
+
)
|
27
|
+
ActiveRecord::Base.connection.enable_query_cache!
|
28
|
+
rescue Exception => ex
|
29
|
+
app.logger.error ex.message
|
11
30
|
end
|
12
|
-
|
13
|
-
ActiveRecord::Base.default_timezone = :utc
|
14
|
-
ActiveRecord::Base.establish_connection(
|
15
|
-
adapter: db_config[:adapter],
|
16
|
-
encoding: db_config[:encoding],
|
17
|
-
charset: db_config[:charset],
|
18
|
-
collation: db_config[:collation],
|
19
|
-
pool: db_config[:pool],
|
20
|
-
host: db_config[:host],
|
21
|
-
username: db_config[:username],
|
22
|
-
password: db_config[:password],
|
23
|
-
database: db_config[:database]
|
24
|
-
)
|
25
|
-
ActiveRecord::Base.connection.enable_query_cache!
|
26
31
|
end
|
27
32
|
|
28
33
|
|
@@ -7,16 +7,20 @@ module HerdstWorker
|
|
7
7
|
|
8
8
|
|
9
9
|
def self.setup(app)
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
10
|
+
rescue
|
11
|
+
environment = app.config.metadata[:DEPLOYMENT_ENV]
|
12
|
+
release = app.config.metadata[:RELEASE_VERSION]
|
13
|
+
sentry_key = app.config.metadata[:SENTRY_KEY]
|
14
|
+
|
15
|
+
Raven.configure do |config|
|
16
|
+
config.current_environment = environment
|
17
|
+
config.release = release
|
18
|
+
config.dsn = sentry_key if sentry_key
|
19
|
+
config.environments = ["preview", "production"]
|
20
|
+
config.async = lambda { |event| Thread.new { Raven.send_event(event) } }
|
21
|
+
end
|
22
|
+
rescue Exception => ex
|
23
|
+
app.logger.error ex.message
|
20
24
|
end
|
21
25
|
end
|
22
26
|
|
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.
|
4
|
+
version: 0.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Herd.St
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-07-
|
11
|
+
date: 2021-07-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|