调整了计划任务的执行顺序,减少处理流程开销

This commit is contained in:
sakitsuki_asahi
2025-09-10 15:39:19 +08:00
parent c82b2948e2
commit 4a18433715
+5 -11
View File
@@ -127,10 +127,6 @@ int main(){
fio.close();
cancelScheduledJob(jobid);
remove((webroot+"/../videodata/tmp/"+cgi.getElement("cid")->getValue()+"-jobid").c_str());
jobid = scheduleCommand("DELETE FROM registerdata WHERE charid = '"+cgi.getElement("cid")->getValue()+"'");
fio.open(webroot+"/../videodata/tmp/"+cgi.getElement("cid")->getValue()+"-jobid",std::ios::out);
fio << jobid;
fio.close();
}
CURL *curl;
CURLcode res = CURLE_OK;
@@ -176,13 +172,11 @@ int main(){
curl_easy_setopt(curl, CURLOPT_READDATA, &upload_data);
curl_easy_setopt(curl, CURLOPT_UPLOAD, 1L);
res = curl_easy_perform(curl);
if(!rereg){
std::string jobid = scheduleCommand("DELETE FROM registerdata WHERE charid = '"+cgi.getElement("cid")->getValue()+"'");
std::fstream fio;
fio.open(webroot+"/../videodata/tmp/"+cgi.getElement("cid")->getValue()+"-jobid",std::ios::out);
fio << jobid;
fio.close();
}
std::string jobid = scheduleCommand("DELETE FROM registerdata WHERE charid = '"+cgi.getElement("cid")->getValue()+"'");
std::fstream fio;
fio.open(webroot+"/../videodata/tmp/"+cgi.getElement("cid")->getValue()+"-jobid",std::ios::out);
fio << jobid;
fio.close();
if(res == CURLE_OK) {
std::cout << "Content-type:text/html\r\n\r\n"
<< "<html>\n"