Skip to content

Commit

Permalink
publish: Some more refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
jelmer committed Sep 22, 2024
1 parent 874c2d5 commit 9ebfc57
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 22 deletions.
14 changes: 3 additions & 11 deletions publish/src/bin/janitor-publish.rs
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ async fn main() -> Result<(), i32> {
});

if args.once {
janitor_publish::publish_pending_ready(state, args.require_binary_diff)
janitor_publish::publish_pending_ready(state)
.await
.map_err(|e| {
log::error!("Failed to publish pending proposals: {}", e);
Expand All @@ -186,21 +186,13 @@ async fn main() -> Result<(), i32> {
state.clone(),
chrono::Duration::seconds(args.interval),
!args.no_auto_publish,
args.require_binary_diff,
));

tokio::spawn(janitor_publish::refresh_bucket_mp_counts(state.clone()));

tokio::spawn(janitor_publish::listen_to_runner(
state.clone(),
args.require_binary_diff,
));
tokio::spawn(janitor_publish::listen_to_runner(state.clone()));

let app = janitor_publish::web::app(
state.clone(),
args.require_binary_diff,
args.modify_mp_limit,
);
let app = janitor_publish::web::app(state.clone());

// run it
let addr = SocketAddr::new(args.listen_address, args.port);
Expand Down
8 changes: 2 additions & 6 deletions publish/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -577,15 +577,11 @@ pub async fn process_queue_loop(
state: Arc<AppState>,
interval: chrono::Duration,
auto_publish: bool,
require_binary_diff: bool,
) {
todo!();
}

pub async fn publish_pending_ready(
state: Arc<AppState>,
require_binary_diff: bool,
) -> Result<(), PublishError> {
pub async fn publish_pending_ready(state: Arc<AppState>) -> Result<(), PublishError> {
todo!();
}

Expand Down Expand Up @@ -620,7 +616,7 @@ pub async fn refresh_bucket_mp_counts(state: Arc<AppState>) -> Result<(), sqlx::
Ok(())
}

pub async fn listen_to_runner(state: Arc<AppState>, require_binary_diff: bool) {
pub async fn listen_to_runner(state: Arc<AppState>) {
todo!();
}

Expand Down
6 changes: 1 addition & 5 deletions publish/src/web.rs
Original file line number Diff line number Diff line change
Expand Up @@ -794,11 +794,7 @@ WHERE run.id = $1
)
}

pub fn app(
state: Arc<AppState>,
require_binary_diff: bool,
modify_mp_limit: Option<i32>,
) -> Router {
pub fn app(state: Arc<AppState>) -> Router {
Router::new()
.route(
"/:campaign/merge-proposals",
Expand Down

0 comments on commit 9ebfc57

Please sign in to comment.