Add workers property, script and service file.
This commit is contained in:
parent
a8400b2796
commit
59e60885a8
|
@ -0,0 +1,11 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
dub clean
|
||||||
|
rm -f web-logbook
|
||||||
|
dub build --build=release
|
||||||
|
echo "Stopping web-logbook service."
|
||||||
|
ssh -f root@andrewlalis.com 'systemctl stop web-logbook'
|
||||||
|
echo "Uploading new binary."
|
||||||
|
scp web-logbook root@andrewlalis.com:/opt/web-logbook/
|
||||||
|
echo "Starting web-logbook service."
|
||||||
|
ssh -f root@andrewlalis.com 'systemctl start web-logbook'
|
|
@ -19,6 +19,9 @@ void main() {
|
||||||
if (props.has("port")) {
|
if (props.has("port")) {
|
||||||
config.port = props.get("port").to!ushort;
|
config.port = props.get("port").to!ushort;
|
||||||
}
|
}
|
||||||
|
if (props.has("workers")) {
|
||||||
|
config.workerPoolSize = props.get("workers").to!size_t;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
initDb();
|
initDb();
|
||||||
HttpServer server = new HttpServer((ref HttpRequestContext ctx) {
|
HttpServer server = new HttpServer((ref HttpRequestContext ctx) {
|
||||||
|
|
|
@ -0,0 +1,13 @@
|
||||||
|
[Unit]
|
||||||
|
Description=web-logbook
|
||||||
|
After=network.target
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
Type=simple
|
||||||
|
User=root
|
||||||
|
WorkingDirectory=/opt/web-logbook
|
||||||
|
ExecStart=/opt/web-logbook/web-logbook
|
||||||
|
Restart=always
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=multi-user.target
|
Loading…
Reference in New Issue