Redis locking problem

while (! $lock) {

        $lock = Redis::set("lock".$id, $random, "nx", "ex" , $ttl);
    }

I want to throw an exception at the timeout I specified in this sentence.

Sep.22,2021

add a line in front of your line of code to determine whether key has expired ~

if ($redis->exists('lock' . $id)) {
    // 
} else {
    // 
}

the above guess about your needs.

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b3102e-2bd65.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b3102e-2bd65.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?