From ebf2d098d5268375d807f4c27cb7c44aa6826034 Mon Sep 17 00:00:00 2001 From: Ozzrell <63107640+Ozzrell@users.noreply.github.com> Date: Tue, 20 Jul 2021 09:04:31 +0200 Subject: [PATCH] unlink() must be after fclose() unlink() cant delete file when is before fclose() --- src/LockingScheduler.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/LockingScheduler.php b/src/LockingScheduler.php index cc6a62d..4f9643d 100644 --- a/src/LockingScheduler.php +++ b/src/LockingScheduler.php @@ -47,8 +47,8 @@ public function run(): void } finally { // Unlock flock($fp, LOCK_UN); - unlink($this->path . '/' . $id . '.lock'); fclose($fp); + unlink($this->path . '/' . $id . '.lock'); } } }