Skip to content

Commit

Permalink
Merge pull request #421 from mnoomnoo/issue-420
Browse files Browse the repository at this point in the history
Fix for issue 420
  • Loading branch information
wsobel authored Mar 9, 2024
2 parents 4811825 + 927c8a6 commit 422e9e1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/mtconnect/configuration/agent_config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ namespace mtconnect::configuration {
LOG(warning) << "... File changed at: " << put_time(localtime(&t), "%F %T");
}

auto delta = min(now - cfgTime, now - devTime);
auto delta = duration_cast<seconds>(min(now - cfgTime, now - devTime));
if (delta < m_monitorDelay)
{
LOG(warning) << "... Waiting " << int32_t((m_monitorDelay - delta).count()) << " seconds";
Expand Down
3 changes: 2 additions & 1 deletion test_package/agent_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2680,7 +2680,8 @@ TEST_F(AgentTest, should_stream_data_with_interval)
ASSERT_FALSE(m_agentTestHelper->m_session->m_chunkBody.empty());
PARSE_XML_CHUNK();

EXPECT_GT(slop, delta) << "delta " << delta.count() << " < delay " << slop.count();
auto deltaMS = duration_cast<milliseconds>(delta);
EXPECT_GT(slop, deltaMS) << "delta " << deltaMS.count() << " < delay " << slop.count();
}
}

Expand Down

0 comments on commit 422e9e1

Please sign in to comment.