Create locks from PHP script as well
authorCameron Ball <cameron@moodle.com>
Tue, 14 May 2019 05:46:48 +0000 (13:46 +0800)
committerCameron Ball <cameron@moodle.com>
Tue, 14 May 2019 05:46:48 +0000 (13:46 +0800)
src/gnb.php

index 453a577..23badfe 100644 (file)
@@ -345,6 +345,8 @@ getTelegram()->addCommand(
 
                 return;
             }
+
+            touch('/tmp/gnb.lock');
             $this->replyWithMessage(
                 [
                     'text' => "Updating songs hash list... This could take a while, hopefully not though."
@@ -372,6 +374,8 @@ getTelegram()->addCommand(
 
                 return;
             }
+
+            touch('/tmp/gnb.lock');
             $this->replyWithMessage(
                 [
                     'text' => "Rebuilding songs hash list... This will take a while."