Compare commits
2 Commits
f5edc44717
...
a66517d24f
Author | SHA1 | Date | |
---|---|---|---|
a66517d24f
|
|||
121943afa7
|
@ -121,7 +121,9 @@ async fn main() -> anyhow::Result<()> {
|
||||
|
||||
if state_ts != max_ts {
|
||||
info!("updating state from {} to {}", state_ts, max_ts);
|
||||
state_db.set(feed.uri.as_str(), max_ts).await;
|
||||
state_db.set(feed.uri.as_str(), max_ts).await.unwrap_or_else(|e| {
|
||||
error!("Failed to set state: {e:?}. continuing...");
|
||||
});
|
||||
debug!("State update complete");
|
||||
}
|
||||
|
||||
|
@ -45,7 +45,7 @@ impl FeedReaderStateDb {
|
||||
filename: String::from(filename)
|
||||
});
|
||||
|
||||
Ok(db.clone())
|
||||
Ok(db)
|
||||
}
|
||||
|
||||
fn lock_state(&self) -> MutexGuard<FeedReaderState> {
|
||||
@ -59,14 +59,14 @@ impl FeedReaderStateDb {
|
||||
&self,
|
||||
uri: &str,
|
||||
dt: DateTime<Utc>
|
||||
) -> () {
|
||||
) -> Result<(), Box<dyn Error>> {
|
||||
|
||||
{
|
||||
debug!("Updating feed reader state");
|
||||
self.lock_state().insert(uri.into(), dt.timestamp().into());
|
||||
}
|
||||
|
||||
self.persist().await.unwrap();
|
||||
self.persist().await
|
||||
}
|
||||
|
||||
#[tracing::instrument(ret, level="debug")]
|
||||
|
Reference in New Issue
Block a user