Skip to content

Commit a9aabb7

Browse files
committed
traverser: fix units of graph_end in traverser::run()
Problem: In dfu_traverser_t::run() the current graph_end is compared to the current `*at` time to ensure the job duration won't overrun the graph expiration. However, the local graph_end variable is created using the default graph_duration.graph_end internal count, which may not be in seconds. Explicitly cast the graph_end to std::chrono::seconds so that the value of the local graph_end variable is the same units as `*at` and `duration` which are seconds. Fixes #1103
1 parent 8da547c commit a9aabb7

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

resource/traversers/dfu.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,9 @@ int dfu_traverser_t::run (Jobspec::Jobspec &jobspec,
290290
}
291291

292292
int rc = -1;
293-
int64_t graph_end = graph_duration.graph_end.time_since_epoch ().count ();
293+
int64_t graph_end = std::chrono::duration_cast<std::chrono::seconds>
294+
(graph_duration.graph_end
295+
.time_since_epoch ()).count ();
294296
detail::jobmeta_t meta;
295297
vtx_t root = get_graph_db ()->metadata.roots.at (dom);
296298
bool x = detail::dfu_impl_t::exclusivity (jobspec.resources, root);

0 commit comments

Comments
 (0)