Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
H
HTTP.sh
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
7
Issues
7
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Laura x Dominika x Patrycja
HTTP.sh
Commits
4132345e
Commit
4132345e
authored
Jul 27, 2020
by
Dominika Liberda
💽
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added workers
parent
0c44c92d
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
37 additions
and
0 deletions
+37
-0
config/app.sh
config/app.sh
+6
-0
http.sh
http.sh
+6
-0
src/worker.sh
src/worker.sh
+22
-0
workers/example/control
workers/example/control
+1
-0
workers/example/worker.sh
workers/example/worker.sh
+2
-0
No files found.
config/app.sh
0 → 100644
View file @
4132345e
# app config - loaded on server bootup
# this example file will get overwritten with application-specific config
# worker_add <worker> <interval>
# ---
# worker_add example 5
\ No newline at end of file
http.sh
View file @
4132345e
...
...
@@ -6,6 +6,12 @@ function ctrl_c() {
echo
-e
"Killed all remaining processes.
\n
Have a great day!!"
}
source
src/worker.sh
if
[[
-f
"config/app.sh"
]]
;
then
source
config/app.sh
fi
source
config/master.sh
echo
"HTTP.sh"
...
...
src/worker.sh
0 → 100755
View file @
4132345e
#!/bin/bash
# worker.sh - setup and control of workers
# worker_add(name, interval)
function
worker_add
()
{
if
[[
-x
"workers/
$1
/worker.sh"
]]
;
then
while
true
;
do
workers/
$1
/worker.sh
;
sleep
$2
;
if
[[
$(
cat
workers/
$1
/control
)
==
"die"
]]
;
then
echo
""
>
workers/
$1
/control
;
while
true
;
do if
[[
$(
cat
workers/
$1
/control
)
==
"run"
]]
;
then
echo
""
>
workers/
$1
/control
;
break
;
fi
;
sleep
$2
;
done
;
fi
;
done
&
else
echo
"You have a broken worker configuration! Please check if worker.sh in worker
$1
is executable."
fi
}
# worker_kill(name)
function
worker_kill
()
{
echo
"die"
>
workers/
$1
/control
}
# worker_resume(name)
function
worker_resume
()
{
echo
"run"
>
workers/
$i
/control
}
\ No newline at end of file
workers/example/control
0 → 100644
View file @
4132345e
workers/example/worker.sh
0 → 100755
View file @
4132345e
#!/bin/bash
date
\ No newline at end of file
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