Skip to content

Commit

Permalink
remove obsolete event emit
Browse files Browse the repository at this point in the history
Signed-off-by: Christian Richter <[email protected]>
  • Loading branch information
dragonchaser committed Jun 6, 2023
1 parent bf520f0 commit a2480a5
Showing 1 changed file with 0 additions and 22 deletions.
22 changes: 0 additions & 22 deletions pkg/share/manager/jsoncs3/jsoncs3.go
Original file line number Diff line number Diff line change
Expand Up @@ -844,16 +844,6 @@ func (m *Manager) ListReceivedShares(ctx context.Context, filters []*collaborati
continue
}
if share.IsExpired(s) {
if err := events.Publish(m.eventStream, events.ShareExpired{
ShareOwner: s.GetOwner(),
ItemID: s.GetResourceId(),
ExpiredAt: time.Unix(int64(s.GetExpiration().GetSeconds()), int64(s.GetExpiration().GetNanos())),
GranteeUserID: s.GetGrantee().GetUserId(),
GranteeGroupID: s.GetGrantee().GetGroupId(),
}); err != nil {
log.Error().Err(err).
Msg("failed to publish share expired event")
}
continue
}

Expand Down Expand Up @@ -941,18 +931,6 @@ func (m *Manager) getReceived(ctx context.Context, ref *collaboration.ShareRefer
}

if share.IsExpired(s) {
// send an event to notify
// TODO: Check if this is a flooding problem if we never write new shares
if err := events.Publish(m.eventStream, events.ShareExpired{
ShareOwner: s.GetOwner(),
ItemID: s.GetResourceId(),
ExpiredAt: time.Unix(int64(s.GetExpiration().GetSeconds()), int64(s.GetExpiration().GetNanos())),
GranteeUserID: s.GetGrantee().GetUserId(),
GranteeGroupID: s.GetGrantee().GetGroupId(),
}); err != nil {
log.Error().Err(err).
Msg("failed to publish share expired event")
}
return nil, errors.Errorf("share is expired: %s", s.GetId())
}

Expand Down

0 comments on commit a2480a5

Please sign in to comment.