mark completed
This commit is contained in:
@@ -51,7 +51,7 @@ logfmt(logINFO, "WrenchMarketImport()");
|
|||||||
try {
|
try {
|
||||||
out["total_record"] = "0";
|
out["total_record"] = "0";
|
||||||
const PGresult *res;
|
const PGresult *res;
|
||||||
res = pgsql_query("SELECT id AS import_id,* FROM market_import WHERE status =1 ORDER BY ecount ASC LIMIT 10");
|
res = pgsql_query("SELECT id AS import_id,* FROM market_import WHERE status = 1 AND completed IS NULL ORDER BY ecount ASC LIMIT 10");
|
||||||
|
|
||||||
if (res != NULL && pgsql_num_rows(res) > 0) {
|
if (res != NULL && pgsql_num_rows(res) > 0) {
|
||||||
out["total_record"] = pgsql_num_rows(res);
|
out["total_record"] = pgsql_num_rows(res);
|
||||||
@@ -63,6 +63,9 @@ logfmt(logINFO, "WrenchMarketImport()");
|
|||||||
map_to_cvars(f, rec);
|
map_to_cvars(f, rec);
|
||||||
market_email(WRENCHBOARD_MARKET_PLAN01_START, rec, rec);
|
market_email(WRENCHBOARD_MARKET_PLAN01_START, rec, rec);
|
||||||
pgsql_query("UPDATE market_import SET ecount=ecount+1 WHERE uid::text='%s'", rec["uid"].c_str());
|
pgsql_query("UPDATE market_import SET ecount=ecount+1 WHERE uid::text='%s'", rec["uid"].c_str());
|
||||||
|
if ( rec["ecount"].Long() > 2 ){
|
||||||
|
pgsql_query("UPDATE market_import SET completed=now() WHERE uid::text='%s'", rec["uid"].c_str());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ret = PHP_API_OK;
|
ret = PHP_API_OK;
|
||||||
|
|||||||
Reference in New Issue
Block a user