Skip to content

Commit

Permalink
return latest processed block (#162)
Browse files Browse the repository at this point in the history
  • Loading branch information
Fraccaman authored Dec 9, 2024
1 parent cc30098 commit a8fde04
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions swagger.yml
Original file line number Diff line number Diff line change
Expand Up @@ -635,6 +635,8 @@ paths:
enum: [chain, governance, parameters, pos, rewards, transactions]
timestamp:
type: number
last_processed_block:
type: number

components:
schemas:
Expand Down
1 change: 1 addition & 0 deletions webserver/src/handler/crawler_state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ pub async fn get_crawlers_timestamps(
|| CrawlersTimestamps {
name: variant.to_string(),
timestamp: 0,
last_processed_block: None
},
|ct| ct.clone(),
)
Expand Down
1 change: 1 addition & 0 deletions webserver/src/response/crawler_state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ use serde::{Deserialize, Serialize};
pub struct CrawlersTimestamps {
pub name: String,
pub timestamp: i64,
pub last_processed_block: Option<i32>
}
2 changes: 2 additions & 0 deletions webserver/src/service/crawler_state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ impl CrawlerStateService {
.map(|crawler| CrawlersTimestamps {
name: crawler.name.to_string(),
timestamp: crawler.timestamp.and_utc().timestamp(),
last_processed_block: crawler.last_processed_block

})
.collect::<Vec<CrawlersTimestamps>>()
})
Expand Down

0 comments on commit a8fde04

Please sign in to comment.