mirror of
https://github.com/valitydev/osquery-1.git
synced 2024-11-06 17:45:22 +00:00
Do not run tryTo on invalid string if status is not ok
Summary: Also it causes debug failure on unchecked Expected when status is not ok Reviewed By: mkareta Differential Revision: D13859377 fbshipit-source-id: 596410350cb91d469dc0a19f0e8eec558e8627bd
This commit is contained in:
parent
04f632f16e
commit
e1045be13e
@ -37,13 +37,13 @@ void DistributedRunner::start() {
|
||||
dist.runQueries();
|
||||
}
|
||||
|
||||
std::string str_acu = "0";
|
||||
Status database = getDatabaseValue(
|
||||
kPersistentSettings, "distributed_accelerate_checkins_expire", str_acu);
|
||||
auto const accelerate_checkins_expire_exp =
|
||||
tryTo<unsigned long int>(str_acu, 10);
|
||||
if (!database.ok() || accelerate_checkins_expire_exp.isError() ||
|
||||
getUnixTime() > accelerate_checkins_expire_exp.get()) {
|
||||
std::string accelerate_checkins_expire_str = "-1";
|
||||
Status status = getDatabaseValue(kPersistentSettings,
|
||||
"distributed_accelerate_checkins_expire",
|
||||
accelerate_checkins_expire_str);
|
||||
if (!status.ok() || getUnixTime() > tryTo<unsigned long int>(
|
||||
accelerate_checkins_expire_str, 10)
|
||||
.takeOr(0ul)) {
|
||||
pause(std::chrono::seconds(FLAGS_distributed_interval));
|
||||
} else {
|
||||
pause(std::chrono::seconds(kDistributedAccelerationInterval));
|
||||
|
Loading…
Reference in New Issue
Block a user