Skip to content

Commit 7e2df27

Browse files
committed
sor/eor triggers use numeric bounds for the unknown fields in validity
this ensures that: - SOR trigger uses validity end which is understood by the framework as unknown - EOR trigger uses validity start which is understood by the framework as unknown For better or worse, we use numerical limits of validity_time_t as unknown/invalid validity timestamps. We could consider using optionals instead, but before we do, this is the easiest fix.
1 parent 35aeb25 commit 7e2df27

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Framework/src/KafkaPoller.cxx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ void fillActivityWithoutTimestamp(const events::Event& event, Activity& activity
6262
void start_of_run::fillActivity(const events::Event& event, Activity& activity)
6363
{
6464
fillActivityWithoutTimestamp(event, activity);
65-
activity.mValidity.setMin(event.timestamp());
65+
activity.mValidity = ValidityInterval{uint64_t(event.timestamp()), std::numeric_limits<validity_time_t>::max()};
6666
}
6767

6868
bool start_of_run::isValid(const events::Event& event, const std::string& environmentID, int runNumber)
@@ -87,7 +87,7 @@ bool start_of_run::isValid(const events::Event& event, const std::string& enviro
8787
void end_of_run::fillActivity(const events::Event& event, Activity& activity)
8888
{
8989
fillActivityWithoutTimestamp(event, activity);
90-
activity.mValidity.setMax(event.timestamp());
90+
activity.mValidity = ValidityInterval{std::numeric_limits<validity_time_t>::min(), uint64_t(event.timestamp())};
9191
}
9292

9393
bool end_of_run::isValid(const events::Event& event, const std::string& environmentID, int runNumber)

0 commit comments

Comments
 (0)