Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Pleroma
pleroma
Commits
91ea3ed8
Verified
Commit
91ea3ed8
authored
Jan 28, 2020
by
Alexander Strizhakov
Browse files
moving restarter application into pleroma repo
parent
7c6e5c54
Pipeline
#22288
failed with stages
in 20 seconds
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
mix.exs
View file @
91ea3ed8
...
...
@@ -172,7 +172,7 @@ defp deps do
git:
"https://git.pleroma.social/pleroma/elixir-libraries/elixir-captcha.git"
,
ref:
"e0f16822d578866e186a0974d65ad58cddc1e2ab"
},
{
:mox
,
"~> 0.5"
,
only:
:test
},
{
:restarter
,
git:
"https://git.pleroma.social/alex.s
/restarter"
}
{
:restarter
,
path:
"..
/restarter"
}
]
++
oauth_deps
()
end
...
...
restarter/lib/pleroma.ex
0 → 100644
View file @
91ea3ed8
defmodule
Restarter
.
Pleroma
do
use
GenServer
def
start_link
(
_
)
do
GenServer
.
start_link
(
__MODULE__
,
[],
name:
__MODULE__
)
end
def
init
(
_
),
do
:
{
:ok
,
%{}}
def
handle_info
(
:after_boot
,
%{
after_boot:
true
}
=
state
),
do
:
{
:noreply
,
state
}
def
handle_info
(
:after_boot
,
state
)
do
restart
(
:pleroma
)
{
:noreply
,
Map
.
put
(
state
,
:after_boot
,
true
)}
end
def
handle_info
({
:restart
,
delay
},
state
)
do
Process
.
sleep
(
delay
)
restart
(
:pleroma
)
{
:noreply
,
state
}
end
defp
restart
(
app
)
do
:ok
=
Application
.
ensure_started
(
app
)
:ok
=
Application
.
stop
(
app
)
:ok
=
Application
.
start
(
app
)
end
end
restarter/lib/restarter.ex
0 → 100644
View file @
91ea3ed8
defmodule
Restarter
do
use
Application
def
start
(
_
,
_
)
do
opts
=
[
strategy:
:one_for_one
,
name:
Restarter
.
Supervisor
]
Supervisor
.
start_link
([
Restarter
.
Pleroma
],
opts
)
end
end
restarter/mix .exs
0 → 100644
View file @
91ea3ed8
defmodule
Restarter
.
MixProject
do
use
Mix
.
Project
def
project
do
[
app:
:restarter
,
version:
"0.1.0"
,
elixir:
"~> 1.8"
,
start_permanent:
Mix
.
env
()
==
:prod
,
deps:
deps
()
]
end
def
application
do
[
mod:
{
Restarter
,
[]}
]
end
defp
deps
,
do
:
[]
end
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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