Skip to content
This repository has been archived by the owner on May 30, 2022. It is now read-only.

Remove skipping for an older event #744

Merged
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 0 additions & 9 deletions web/datapipeline/projector.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,15 +53,6 @@ func (p *projector) Project(dataCollectedEvent *DataCollectedEvent) error {
var subscription Subscription
tx.Clauses(clause.Locking{Strength: "UPDATE"}).Where(&Subscription{ProjectorID: p.ID, AgentID: dataCollectedEvent.AgentID}).First(&subscription)

if subscription.LastProjectedEventID >= dataCollectedEvent.ID {
log.Warnf("Projector: %s received an old event: %s %s %d. Skipping",
p.ID, dataCollectedEvent.DiscoveryType,
dataCollectedEvent.AgentID,
dataCollectedEvent.ID)

return nil
}

tx.Clauses(clause.OnConflict{
UpdateAll: true,
}).Create(&Subscription{
Expand Down