How to prevent repeated requests when performing a time-consuming job operation in play framework 1?

perform a time-consuming job operation in play1 to prevent repeated requests for Cache.set (order.id, true) in job to execute code Cache.delete (order.id);

    if (Cache.get(order.id)!=null) {
        fail("");
    }

is this feasible? The server doesn"t seem to work. Local testing can be

.
Apr.06,2021

can be written asynchronously, such as CompletableFuture.runAsync () , and then declare a volatile boolean variable control state to identify whether the task is executing, such as

volatile boolean flag = false;

void func(){
    if (!flag) {
        CompletableFuture.runAsync(() -> {
            try {
                flag = true;
                doWork();
            } finally {
                flag = false;
            }
        });
    } else {
        failWork();
    }
}
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-1eb3673-244d.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-1eb3673-244d.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?