From 31d4c7ef73453ee3d48810a782057ef4667ce1ca Mon Sep 17 00:00:00 2001 From: fly Date: Fri, 5 Mar 2021 19:27:02 +0000 Subject: [PATCH] Fixed locking Signed-off-by: fly --- web/index.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/web/index.php b/web/index.php index 4d39251..c318b6d 100644 --- a/web/index.php +++ b/web/index.php @@ -63,7 +63,6 @@ function rel_lock($con) function set_status($con, $name, $status, $type) { - get_lock($con); if ($type == "area") { // Get parent ID @@ -109,18 +108,21 @@ function set_status($con, $name, $status, $type) $stmt->execute(); $stmt->close(); } - rel_lock($con); } if ($action == "set") { if (isset($_POST['tile']) && $_POST['tile'] != "") { + get_lock($con); set_status($con, $_POST['tile'], $_POST['status'], "tile"); + rel_lock($con); } else if (isset($_POST['area']) && $_POST['area'] != "") { + get_lock($con); set_status($con, $_POST['area'], $_POST['status'], "area"); + rel_lock($con); } else { @@ -148,7 +150,6 @@ else if ($action == "get-job") { quit(); } - rel_lock($con); $ret->job = $result->fetch_array()[0]; if ($ret->job == Null) { @@ -158,6 +159,7 @@ else if ($action == "get-job") { set_status($con, $ret->job, "started", "tile"); } + rel_lock($con); } else if ($action == "get-done") {