forest_liana 2.9.1 → 2.9.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/forest_liana/engine.rb +15 -2
- data/lib/forest_liana/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: aec5c04b564d1ea85d2af7b7e097a27148996842
|
4
|
+
data.tar.gz: 012fff66c5d6457601ba654b6eff4e4d07652022
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 19218a4d18faff38146343fae86be93737b8c6caf716f779b7772b1c6030a101aebe82b29b5029f65600854f75c356fbdc0d48e223bb5dfce790d2057e3f559a
|
7
|
+
data.tar.gz: 5b296b887174352eeb49857b1e6c8f34789d4f951e12d9370616417e79d7df21ec2487fd7301c8d12d079f2fdc58a958eeaa5d35964d752361f5c58abb9f260a
|
data/lib/forest_liana/engine.rb
CHANGED
@@ -36,6 +36,17 @@ module ForestLiana
|
|
36
36
|
File.basename($0) == 'rake'
|
37
37
|
end
|
38
38
|
|
39
|
+
def database_available?
|
40
|
+
database_available = true
|
41
|
+
begin
|
42
|
+
ActiveRecord::Base.connection_pool.with_connection { |connection| connection.active? }
|
43
|
+
rescue => error
|
44
|
+
database_available = false
|
45
|
+
FOREST_LOGGER.error "No Apimap sent to Forest servers, it seems that the database is not accessible:\n#{error}"
|
46
|
+
end
|
47
|
+
database_available
|
48
|
+
end
|
49
|
+
|
39
50
|
error = configure_forest_cors unless ENV['FOREST_CORS_DEACTIVATED']
|
40
51
|
|
41
52
|
config.after_initialize do |app|
|
@@ -47,8 +58,10 @@ module ForestLiana
|
|
47
58
|
|
48
59
|
app.eager_load!
|
49
60
|
|
50
|
-
|
51
|
-
|
61
|
+
if database_available?
|
62
|
+
# NOTICE: Do not run the code below on rails g forest_liana:install.
|
63
|
+
Bootstraper.new(app).perform if ForestLiana.env_secret || ForestLiana.secret_key
|
64
|
+
end
|
52
65
|
end
|
53
66
|
end
|
54
67
|
end
|
data/lib/forest_liana/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: forest_liana
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.9.
|
4
|
+
version: 2.9.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sandro Munda
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-07-
|
11
|
+
date: 2018-07-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|