Skip to content

Commit 84b09ee

Browse files
committed
Fix generation time
1 parent 8e29505 commit 84b09ee

2 files changed

Lines changed: 3 additions & 1 deletion

File tree

registry_wizard/src/modules/explorer/handlers.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ pub(super) async fn index_handler(request_headers: HeaderMap, State(u): State<Ar
2525
let mut m = serde_json::map::Map::new();
2626
m.insert("commit".to_string(), serde_json::to_value(&u.commit_hash).unwrap_or_default());
2727
m.insert("roa".to_string(), serde_json::to_value(!u.roa_disabled).unwrap_or_default());
28-
m.insert("time".to_string(), serde_json::to_value(&u.etag).unwrap_or_default());
28+
m.insert("time".to_string(), serde_json::to_value(&u.generation_time).unwrap_or_default());
2929
let info_val = serde_json::to_value(&m).unwrap_or_default();
3030
let jr = serde_json::to_value(&u.index);
3131
if jr.is_err() {

registry_wizard/src/modules/explorer/state.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ pub(super) struct AppState {
1212
pub objects: HashMap<String, Vec<WebRegistryObject>>,
1313
pub index: HashMap<String, Vec<String>>,
1414
pub etag: String,
15+
pub generation_time: String,
1516
pub commit_hash: String,
1617
pub roa4: Option<String>,
1718
pub roa6: Option<String>,
@@ -76,6 +77,7 @@ pub(super) async fn update_registry_data(registry_root: PathBuf, app_state: Arc<
7677
app_state_lock.objects = graph_web;
7778
app_state_lock.index = index_map;
7879
app_state_lock.etag = format!("\"{}\"", get_current_unix_time());
80+
app_state_lock.generation_time = get_current_unix_time().to_string();
7981
app_state_lock.commit_hash = commit_hash;
8082
app_state_lock.roa4 = roa4;
8183
app_state_lock.roa6 = roa6;

0 commit comments

Comments
 (0)