forked from SO4-Markets/so4-oracle
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlib.rs
More file actions
39 lines (34 loc) · 816 Bytes
/
Copy pathlib.rs
File metadata and controls
39 lines (34 loc) · 816 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
pub mod price;
pub mod auth;
pub mod binance;
pub mod chain;
pub mod coinbase;
pub mod config;
pub mod fixed;
pub mod http;
pub mod keeper;
pub mod keeper_loop;
pub mod metrics;
pub mod network_config;
pub mod price_loop;
pub mod prices;
pub mod pyth;
pub mod retry;
pub mod signing;
pub mod state;
pub mod stellar_rpc;
pub mod submit;
pub mod api;
pub use config::{Config, EnvErrors};
pub use state::AppState;
use std::time::{SystemTime, UNIX_EPOCH};
/// Returns the current Unix timestamp in seconds.
///
/// This is a convenience wrapper around `SystemTime::now() - UNIX_EPOCH`
/// that returns the duration as seconds (`u64`). Closes #399.
pub fn current_timestamp_secs() -> u64 {
SystemTime::now()
.duration_since(UNIX_EPOCH)
.map(|duration| duration.as_secs())
.unwrap_or(0)
}