Skip to content

Commit

Permalink
add tests for calendar scheduling logic; persist sent pings
Browse files Browse the repository at this point in the history
This also removes sent ping GC'ing on everything but startup. Lack of GC
only becomes a problem if many events are leaking, and we're only going
to ping O(dozens) of events per week.
  • Loading branch information
gburgessiv committed Jan 4, 2025
1 parent c3bcc36 commit ae662df
Show file tree
Hide file tree
Showing 5 changed files with 512 additions and 84 deletions.
1 change: 0 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,6 @@ WORKDIR /home/llvmbb_monitor

COPY --chmod=555 docker/run_buildbot_monitor.sh .
COPY --from=build \
/home/llvmbb_monitor/code/target/release/calendar_check \
/home/llvmbb_monitor/code/target/release/llvm_buildbot_monitor \
llvm_buildbot_monitor/

Expand Down
7 changes: 4 additions & 3 deletions calendar_check/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,21 +16,22 @@ fn utc_time_to_api_time(time: &UtcTime) -> String {
time.to_rfc3339_opts(chrono::SecondsFormat::Secs, use_z)
}

#[derive(Debug)]
#[derive(Debug, Default)]
pub enum CommunityEventType {
#[default]
OfficeHours,
SyncUp,
}

#[derive(Debug)]
#[derive(Debug, Default)]
pub struct CommunityEventDescriptionData {
pub event_type: CommunityEventType,
pub mention_users: Vec<Box<str>>,
pub mention_channels: Vec<Box<str>>,
pub ping_duration_before_start_mins: Option<u32>,
}

#[derive(Debug)]
#[derive(Debug, Default)]
pub struct CommunityEvent {
// Unix millis.
pub start_time: UtcTime,
Expand Down
Loading

0 comments on commit ae662df

Please sign in to comment.