Skip to content
Snippets Groups Projects
Commit ab248cf0 authored by echicken's avatar echicken
Browse files

Wait for user 1 to exist, then start doing things.

parent 09585d82
Branches
Tags
No related merge requests found
......@@ -114,8 +114,8 @@ var cleanUp = function() {
jsonClient.disconnect();
}
if(system.lastuser < 1)
exit();
while(system.lastuser < 1)
mswait(15000);
try {
initJson();
......
......@@ -160,6 +160,9 @@ var pushLevels = function() {
// Set things up
var init = function() {
while(system.lastuser < 1)
mswait(15000);
// Load the server config if it exists, or fake it if not
if(file_exists(root + "server.ini")) {
var f = new File(root + "server.ini");
......@@ -228,9 +231,6 @@ var cleanUp = function() {
jsonClient.disconnect();
}
if(system.lastuser < 1)
exit();
// Try to do things, log an error if necessary
try {
init();
......
......@@ -100,6 +100,9 @@ var processUpdate = function(update) {
var init = function() {
while(system.lastuser < 1)
mswait(15000);
timer = new Timer();
var f = new File(root + "service.ini");
......@@ -176,9 +179,6 @@ var cleanUp = function() {
jsonClient.disconnect();
}
if(system.lastuser < 1)
exit();
try {
init();
main();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment