Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Switch to GitLab Next
Sign in / Register
Toggle navigation
Open sidebar
Kazarma
MatrixAppService.ex
Commits
36322732
Verified
Commit
36322732
authored
Dec 09, 2020
by
Pierre de Lacroix
Browse files
dont' start the repo unless necessary
parent
00c21255
Pipeline
#227233287
failed with stage
in 3 minutes and 50 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
8 deletions
+17
-8
config/test.exs
config/test.exs
+1
-0
lib/matrix_app_service/application.ex
lib/matrix_app_service/application.ex
+16
-8
No files found.
config/test.exs
View file @
36322732
...
...
@@ -23,6 +23,7 @@ config :logger, level: :warn
config
:matrix_app_service
,
internal_supervisor:
true
,
internal_repo:
true
,
transaction_adapter:
MatrixAppService
.
TestTransactionAdapter
,
room_adapter:
MatrixAppService
.
TestRoomAdapter
,
user_adapter:
MatrixAppService
.
TestUserAdapter
,
...
...
lib/matrix_app_service/application.ex
View file @
36322732
...
...
@@ -18,16 +18,20 @@ defmodule MatrixAppService.Application do
]
children
=
if
start_endpoint?
()
do
[
# MatrixAppServiceWeb.Endpoint
{
MatrixAppServiceWeb
.
Endpoint
,
endpoint_config
()},
if
start_endpoint?
(),
do
:
[
{
MatrixAppServiceWeb
.
Endpoint
,
endpoint_config
()}
|
children
],
else
:
children
children
=
if
start_repo?
(),
do
:
[
MatrixAppService
.
Repo
|
children
]
else
children
end
],
else
:
children
# See https://hexdocs.pm/elixir/Supervisor.html
# for other strategies and supported options
...
...
@@ -49,6 +53,10 @@ defmodule MatrixAppService.Application do
Application
.
get_env
(
:matrix_app_service
,
:internal_supervisor
,
false
)
end
def
start_repo?
()
do
Application
.
get_env
(
:matrix_app_service
,
:internal_repo
,
false
)
end
def
endpoint_config
()
do
[
transaction_adapter:
Application
.
fetch_env!
(
:matrix_app_service
,
:transaction_adapter
),
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment