Skip to content
Snippets Groups Projects

fix: more robust CALL_ME_LATER date checking. Closes issue #12

Merged Ghost User requested to merge issue12 into master
1 file
+ 4
2
Compare changes
  • Side-by-side
  • Inline
@@ -4,8 +4,10 @@
#include "../pempek_assert.hpp"
#include "json_workload.hpp"
#include "loguru.hpp"
#include <cmath>
#include <limits>
#include <map>
#include <math.h>
#include <string>
DynScheduler::DynScheduler(Workload *workload, SchedulingDecision *decision,
@@ -86,7 +88,7 @@ void DynScheduler::make_decisions(double date,
/* Time of next_submission might have changed in response to feedback */
double new_date_of_next_submission = broker->next_submission(date);
if (abs(date - new_date_of_next_submission) < .00001)
if (new_date_of_next_submission == lround(date))
{
submit_broker_jobs(date);
new_date_of_next_submission = broker->next_submission(date);
@@ -115,7 +117,7 @@ void DynScheduler::on_requested_call(double date)
ISchedulingAlgorithm::on_requested_call(date);
/* Check if this call concerns the broker */
if (broker_enabled && abs(date - broker->next_submission(date)) < .00001)
if (broker_enabled && broker->next_submission(date) == lround(date))
{
/* Handle the jobs to submit */
submit_broker_jobs(date);
Loading