Skip to content

Commit 25ffccf

Browse files
committed
feat: cron + individual route for updating installations ids directly from github in the database
1 parent 89ba93e commit 25ffccf

File tree

9 files changed

+471
-14
lines changed

9 files changed

+471
-14
lines changed

Cargo.lock

Lines changed: 201 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

fplus-database/src/database/allocators.rs

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -115,10 +115,21 @@ pub async fn create_or_update_allocator(
115115
let conn = get_database_connection().await?;
116116
let mut allocator_active_model = allocator_model.into_active_model();
117117

118-
allocator_active_model.installation_id = Set(installation_id);
119-
allocator_active_model.multisig_address = Set(multisig_address);
120-
allocator_active_model.verifiers_gh_handles = Set(verifiers_gh_handles);
121-
allocator_active_model.multisig_threshold = Set(multisig_threshold);
118+
if installation_id.is_some() {
119+
allocator_active_model.installation_id = Set(installation_id);
120+
}
121+
122+
if multisig_address.is_some() {
123+
allocator_active_model.multisig_address = Set(multisig_address);
124+
}
125+
126+
if verifiers_gh_handles.is_some() {
127+
allocator_active_model.verifiers_gh_handles = Set(verifiers_gh_handles);
128+
}
129+
130+
if multisig_threshold.is_some() {
131+
allocator_active_model.multisig_threshold = Set(multisig_threshold);
132+
}
122133

123134
let updated_model = allocator_active_model.update(&conn).await?;
124135

0 commit comments

Comments
 (0)