Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 12 additions & 0 deletions workers/server/src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@ pub struct AppState {
pub(crate) finalizations: Arc<crate::wake::Wake>,
/// Sent after a commit that leaves a push job a candidate to publish.
pub(crate) publications: Arc<crate::wake::Wake>,
/// Bazel generations whose objects or targets may have changed since
/// they were swept.
pub(crate) bazel: Arc<crate::bazel::Sweeps>,
/// How long an idle worker sleeps before it looks without being woken.
pub(crate) idle_period: Duration,
pub(crate) cdn: Option<Arc<dyn cdn::PurgeTransport>>,
Expand Down Expand Up @@ -84,6 +87,7 @@ impl AppState {
evictions: Arc::default(),
finalizations: Arc::default(),
publications: Arc::default(),
bazel: Arc::default(),
idle_period: crate::wake::FALLBACK,
pool,
storage,
Expand Down Expand Up @@ -124,6 +128,14 @@ impl AppState {
self
}

/// Change, before starting workers or requests, how soon one Bazel sweep
/// pass may follow another, and how often every generation is swept
/// unasked. A minute and an hour by default.
pub fn with_bazel_sweep_periods(mut self, settle: Duration, fallback: Duration) -> Self {
self.bazel = Arc::new(crate::bazel::Sweeps::new(settle, fallback));
self
}

/// Start the durable multipart consumers once. Tower hosts and tests use
/// this same lifecycle as serve(), rather than a request-local shortcut.
pub fn start_upload_finalizers(&self) -> CancellationToken {
Expand Down
Loading
Loading