MCPcopy Create free account
hub / github.com/aws/amazon-q-developer-cli / should_send_heartbeat

Method should_send_heartbeat

crates/chat-cli/src/database/mod.rs:350–359  ·  view source on GitHub ↗

Check if daily heartbeat should be sent

(&self)

Source from the content-addressed store, hash-verified

348
349 /// Check if daily heartbeat should be sent
350 pub fn should_send_heartbeat(&self) -> bool {
351 use chrono::Utc;
352 let today = Utc::now().format("%Y-%m-%d").to_string();
353
354 match self.get_entry::<String>(Table::State, HEARTBEAT_DATE_KEY) {
355 Ok(Some(last_date)) => last_date != today,
356 Ok(None) => true, // First time - definitely send
357 Err(_) => false, // Database error - don't send (might have already sent)
358 }
359 }
360
361 /// Record that heartbeat was sent today
362 pub fn record_heartbeat_sent(&self) -> Result<(), DatabaseError> {

Callers 1

executeMethod · 0.80

Calls 2

to_stringMethod · 0.80
formatMethod · 0.45

Tested by

no test coverage detected