Attached refresh process
This commit is contained in:
@@ -156,12 +156,32 @@ return 0;
|
|||||||
}
|
}
|
||||||
|
|
||||||
long ScheduleTransferJobs(CVars in, CVars &out){
|
long ScheduleTransferJobs(CVars in, CVars &out){
|
||||||
// if ( load_db_record(out, "SELECT initiatingamount, status, added,proc FROM money_transfer WHERE added > (now() - interval '3000 minutes') AND status = 0 ORDER BY id DESC LIMIT 100 ")> 0){
|
char vname[30];
|
||||||
// if ( out["pending_count"].Long() > 0 ){
|
long ret = PHP_API_BAD_PARAM;
|
||||||
// alert_email(WRB_CRONJOB_PENDINGSM,out, out);
|
try {
|
||||||
// }
|
out["total_record"] = "0";
|
||||||
// }
|
const PGresult *res;
|
||||||
return 0;
|
res = pgsql_query("SELECT initiatingamount, status, added,proc FROM money_transfer WHERE added > (now() - interval '3000 minutes') AND status = 0 ORDER BY id DESC LIMIT 100");
|
||||||
|
|
||||||
|
if (res != NULL && pgsql_num_rows(res) > 0) {
|
||||||
|
out["total_record"] = pgsql_num_rows(res);
|
||||||
|
|
||||||
|
for (int i = 0, n = pgsql_num_rows(res); i < n; i++) {
|
||||||
|
map<const char*, const char*>f = pgsql_fetch_assoc(res, i);
|
||||||
|
if (f.empty()) continue;
|
||||||
|
CVars rec;
|
||||||
|
map_to_cvars(f, rec);
|
||||||
|
pgsql_query("UPDATE money_transfer SET proc= 100 "
|
||||||
|
" WHERE proc = 0 AND id = %lu AND uid = '%s'", rec["id"].Long(),rec["uid"].c_str()); // move the status so no retry
|
||||||
|
}
|
||||||
|
}
|
||||||
|
ret = PHP_API_OK;
|
||||||
|
out["status"] = "OK";
|
||||||
|
} catch (bad_parameter) {
|
||||||
|
logfmt(logINFO, "ERROR CALL long ScheduleTransferJobs(CVars in, CVars &out)");
|
||||||
|
}
|
||||||
|
logfmt(logINFO, "/ScheduleTransferJobs()");
|
||||||
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
long TestNotificationsJobs(CVars in, CVars &out){
|
long TestNotificationsJobs(CVars in, CVars &out){
|
||||||
|
|||||||
Reference in New Issue
Block a user