Skip to content

Commit

Permalink
lib: skip setting time + location if RTC fails
Browse files Browse the repository at this point in the history
  • Loading branch information
gauteh committed Oct 30, 2024
1 parent 9d12871 commit 64aed69
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion sfy-buoy/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,10 @@ impl Location {

const LOCATION_DIFF: i64 = 1 * 60_000; // [ms]: 1 minute

let now = state.now().unwrap_or(FUTURE).and_utc().timestamp_millis();
let now = state
.now()
.map(|t| t.and_utc().timestamp_millis())
.ok_or(notecard::NoteError::WrongState)?;

match self.state {
Retrieved(t) | Trying(t) if (now - t) > LOCATION_DIFF => {
Expand Down

0 comments on commit 64aed69

Please sign in to comment.