Skip to content

Commit

Permalink
chore: More logs, longer readiness/liveness period (#208)
Browse files Browse the repository at this point in the history
chore: More logs, longer readiness/livenes period
  • Loading branch information
wojciechsromek authored Aug 7, 2024
1 parent 7f0fdda commit 51a9fcb
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
4 changes: 3 additions & 1 deletion deploy/stage/common-values-gpu-iris-mpc.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
image: "ghcr.io/worldcoin/gpu-iris-mpc:v0.2.8-alpha"
image: "ghcr.io/worldcoin/gpu-iris-mpc:v0.2.9-alpha"

environment: stage
replicaCount: 1
Expand All @@ -15,11 +15,13 @@ ports:
protocol: TCP

livenessProbe:
initialDelaySeconds: 90
httpGet:
path: /health
port: health

readinessProbe:
initialDelaySeconds: 90
httpGet:
path: /health
port: health
Expand Down
6 changes: 5 additions & 1 deletion src/bin/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -263,13 +263,16 @@ async fn initialize_iris_dbs(
(codes_db, masks_db)
};

tracing::info!("Initialize iris db: Loading from DB");
// Load DB from persistent storage.
let mut store_len = 0;
while let Some(iris) = store.stream_irises().await.next().await {
let iris = iris?;
codes_db.extend(iris.left_code());
masks_db.extend(iris.left_mask());
store_len += 1;

tracing::info!("Initialize iris db: Loaded {} entries from DB", store_len);
}

Ok((codes_db, masks_db, store_len))
Expand All @@ -283,6 +286,7 @@ async fn replay_result_events(
) -> eyre::Result<()> {
let result_events = store.last_results(SYNC_RESULTS).await?;

tracing::info!("Replaying {} results", result_events.len());
for result_event in result_events {
sns_client
.publish()
Expand Down Expand Up @@ -323,7 +327,7 @@ async fn main() -> eyre::Result<()> {
tracing::info!("Replaying results");
replay_result_events(&store, &sns_client, &config.results_topic_arn, party_id).await?;

tracing::info!("Replaying results");
tracing::info!("Initialize iris db");
let (mut codes_db, mut masks_db, store_len) = initialize_iris_dbs(party_id, &store).await?;

let my_state = SyncState {
Expand Down

0 comments on commit 51a9fcb

Please sign in to comment.