Commit 8f884ac9 authored by Marco De Marco's avatar Marco De Marco
Browse files

Last second protection in metadata retrieve query

parent e8c33c7a
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -143,7 +143,9 @@ DBManager::RowsetSP DBManager::retrieveNewTuples(std::string schema,

    RowsetSP rows(new soci::rowset<soci::row>(session.prepare << "select * from "
        << schema << "." << table << " where update_time>'"
        << boost::posix_time::to_iso_string(timestamp) << "' order by update_time asc"));
        << boost::posix_time::to_iso_string(timestamp)
        << "' and update_time<=DATE_SUB(now(), INTERVAL 1 SECOND)"
        << " order by update_time asc"));

    return rows;
}