Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

return latest processed block #162

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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