Mysql
 sql >> Base de données >  >> RDS >> Mysql

Priorité aux transactions ?

J'essaierais de Keep It Simple S....., et j'utiliserais un processus de verrouillage de fichier simple comme celui-ci en haut de votre script cron existant.

$fp = fopen("/tmp/my_cron_lock.txt", "r+");

if ( ! flock($fp, LOCK_EX)) {
    // other cron is overrunning so
    // I'll get restarted in 3 mins 
    // so I will let other job finish

    fclose($fp);

    exit;
}

// existing script



// free the lock, 
// although this will happen automatically when script terminates

    fclose($fp);
?>