Skip to content

Commit

Permalink
fix: time between updates from nearblocks
Browse files Browse the repository at this point in the history
  • Loading branch information
Tguntenaar committed Dec 19, 2024
1 parent 4b6c500 commit d1167e2
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 9 deletions.
7 changes: 3 additions & 4 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ anyhow = "1.0.76"
rocket_cors = "0.6.0"
utoipa-swagger-ui = { version = "7.1", features = ["rocket"] }
reqwest = "0.12.8"
near-api = { git = "https://github.com/near/near-api-rs" }
near-api = "0.3.0"
near-jsonrpc-client = "0.14.0"
regex = "1.11.1"
base64 = "0.22.1"
Expand Down
4 changes: 2 additions & 2 deletions src/entrypoints/proposal/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ async fn get_proposals(
let last_updated_info = db.get_last_updated_info().await.unwrap();

if current_timestamp_nano - last_updated_info.after_date
>= chrono::Duration::seconds(60).num_nanoseconds().unwrap()
>= chrono::Duration::seconds(1).num_nanoseconds().unwrap()
{
update_nearblocks_data(
db.inner(),
Expand Down Expand Up @@ -127,7 +127,7 @@ async fn get_proposal_with_all_snapshots(
let last_updated_info = db.get_last_updated_info().await.unwrap();

if current_timestamp_nano - last_updated_info.after_date
>= chrono::Duration::seconds(60).num_nanoseconds().unwrap()
>= chrono::Duration::seconds(1).num_nanoseconds().unwrap()
{
update_nearblocks_data(
db.inner(),
Expand Down
4 changes: 2 additions & 2 deletions src/entrypoints/rfp/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ async fn get_rfps(
let last_updated_info = db.get_last_updated_info().await.unwrap();

if current_timestamp_nano - last_updated_info.after_date
>= chrono::Duration::seconds(60).num_nanoseconds().unwrap()
>= chrono::Duration::seconds(1).num_nanoseconds().unwrap()
{
update_nearblocks_data(
db.inner(),
Expand Down Expand Up @@ -135,7 +135,7 @@ async fn get_rfp_with_snapshots(
let last_updated_info = db.get_last_updated_info().await.unwrap();

if current_timestamp_nano - last_updated_info.after_date
>= chrono::Duration::seconds(60).num_nanoseconds().unwrap()
>= chrono::Duration::seconds(1).num_nanoseconds().unwrap()
{
update_nearblocks_data(
db.inner(),
Expand Down

0 comments on commit d1167e2

Please sign in to comment.