Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
pleroma
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Alex Gleason
pleroma
Commits
91ea3ed8
Verified
Commit
91ea3ed8
authored
5 years ago
by
Alexander Strizhakov
Browse files
Options
Downloads
Patches
Plain Diff
moving restarter application into pleroma repo
parent
7c6e5c54
No related branches found
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
mix.exs
+1
-1
1 addition, 1 deletion
mix.exs
restarter/lib/pleroma.ex
+28
-0
28 additions, 0 deletions
restarter/lib/pleroma.ex
restarter/lib/restarter.ex
+8
-0
8 additions, 0 deletions
restarter/lib/restarter.ex
restarter/mix .exs
+21
-0
21 additions, 0 deletions
restarter/mix .exs
with
58 additions
and
1 deletion
mix.exs
+
1
−
1
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
...
...
This diff is collapsed.
Click to expand it.
restarter/lib/pleroma.ex
0 → 100644
+
28
−
0
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
This diff is collapsed.
Click to expand it.
restarter/lib/restarter.ex
0 → 100644
+
8
−
0
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
This diff is collapsed.
Click to expand it.
restarter/mix .exs
0 → 100644
+
21
−
0
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
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment