arkaan 0.7.12 → 0.7.13
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/arkaan/utils/controller.rb +2 -0
- data/lib/arkaan/utils/micro_service.rb +6 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c1f1e209b95f9eb060e34b7c4078d601f880ef9f
|
4
|
+
data.tar.gz: 86564f1d3282b2a95d7e15273636d490312285ef
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b793e8c3d05f7b98bd0c86db6c396ad4b16db2c19de6b6a64a570df790a18861bf3e925ab4cf7e3929cb90e7436126add00c50fea0459454e0911af00e7913a9
|
7
|
+
data.tar.gz: e1bf66feccaf301a0cb8671a79b2080b5ee8053fff3425dcad736b3eeecb9defda27ec183a5627463fc7b4f9ae078db9d94e8ef59c69da06bb2e48302af8e9c5
|
@@ -64,10 +64,13 @@ module Arkaan
|
|
64
64
|
|
65
65
|
private
|
66
66
|
|
67
|
+
# Registers the service in the database if it has not been created already.
|
67
68
|
def register_service
|
68
69
|
@service = Arkaan::Monitoring::Service.create(key: @name, path: "/#{@name}")
|
69
70
|
end
|
70
71
|
|
72
|
+
# Register the instance of the currently deployed service in the database.
|
73
|
+
# @return [Arkaan::Monitoring::Instance] the instance of the micro service currently running.
|
71
74
|
def register_instance
|
72
75
|
instance = @service.instances.where(url: ENV['SERVICE_URL']).first
|
73
76
|
if instance.nil?
|
@@ -76,6 +79,9 @@ module Arkaan
|
|
76
79
|
return instance
|
77
80
|
end
|
78
81
|
|
82
|
+
# Loads the configuration for Mongoid, the files of the application, and registers the service and the instance in the database.
|
83
|
+
# @param test_mode [Boolean] TRUE to run in test mode (from /spec), FALSE otherwise.
|
84
|
+
# @return [Arkaan::Utils::MicroService] the current instance of the micro service to chain other calls.
|
79
85
|
def load_application(test_mode: false)
|
80
86
|
load_mongoid_configuration
|
81
87
|
if !!(@name && location)
|
@@ -83,7 +89,6 @@ module Arkaan
|
|
83
89
|
register_service if @service.nil?
|
84
90
|
register_instance
|
85
91
|
if service
|
86
|
-
@location = File.join(location, '..') if test_mode
|
87
92
|
load_standard_files
|
88
93
|
load_test_files if test_mode
|
89
94
|
end
|