Skip to content

Commit

Permalink
Random keying
Browse files Browse the repository at this point in the history
  • Loading branch information
rxdn committed Oct 26, 2024
1 parent 9419818 commit 771cfff
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions event-stream/src/publisher.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,11 @@ impl Publisher {
})
}

pub fn send(&self, ev: &event_forwarding::Event, guild_id: u64) -> Result<()> {
pub fn send(&self, ev: &event_forwarding::Event, _guild_id: u64) -> Result<()> {
let marshalled = serde_json::to_vec(ev)?;

let key = guild_id.to_string();
let record = BaseRecord::to(&self.topic.as_str())
.payload(&marshalled)
.key(key.as_str());
let record: BaseRecord<'_, String, Vec<u8>> = BaseRecord::to(&self.topic.as_str())
.payload(&marshalled);

let should_poll = self.since_last_poll.compare_exchange(POLL_INTERVAL, 0, Ordering::Relaxed, Ordering::Relaxed).is_ok();
self.since_last_poll.fetch_add(1, Ordering::Relaxed);
Expand Down

0 comments on commit 771cfff

Please sign in to comment.