Skip to content

Commit c3ae26e

Browse files
committed
deploy: e0a0cca
1 parent 10b00f3 commit c3ae26e

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

pr/94/docs/src/iroh_blobs/store/fs/gc.rs.html

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -354,7 +354,12 @@
354354
<a href="#353" id="353">353</a>
355355
<a href="#354" id="354">354</a>
356356
<a href="#355" id="355">355</a>
357-
<a href="#356" id="356">356</a></pre></div><pre class="rust"><code><span class="kw">use </span>std::{collections::HashSet, pin::Pin, sync::Arc};
357+
<a href="#356" id="356">356</a>
358+
<a href="#357" id="357">357</a>
359+
<a href="#358" id="358">358</a>
360+
<a href="#359" id="359">359</a>
361+
<a href="#360" id="360">360</a>
362+
<a href="#361" id="361">361</a></pre></div><pre class="rust"><code><span class="kw">use </span>std::{collections::HashSet, pin::Pin, sync::Arc};
358363

359364
<span class="kw">use </span>bao_tree::ChunkRanges;
360365
<span class="kw">use </span>genawaiter::sync::{Co, Gen};
@@ -510,6 +515,7 @@
510515
&gt;;
511516

512517
<span class="kw">pub async fn </span>gc_run_once(store: <span class="kw-2">&amp;</span>Store, live: <span class="kw-2">&amp;mut </span>HashSet&lt;Hash&gt;) -&gt; <span class="kw">crate</span>::api::Result&lt;()&gt; {
518+
<span class="macro">debug!</span>(externally_protected = live.len(), <span class="string">"gc: start"</span>);
513519
{
514520
store.clear_protected().<span class="kw">await</span><span class="question-mark">?</span>;
515521
<span class="kw">let </span><span class="kw-2">mut </span>stream = gc_mark(store, live);
@@ -528,6 +534,7 @@
528534
}
529535
}
530536
}
537+
<span class="macro">debug!</span>(total_protected = live.len(), <span class="string">"gc: sweep"</span>);
531538
{
532539
<span class="kw">let </span><span class="kw-2">mut </span>stream = gc_sweep(store, live);
533540
<span class="kw">while let </span><span class="prelude-val">Some</span>(ev) = stream.next().<span class="kw">await </span>{
@@ -545,13 +552,16 @@
545552
}
546553
}
547554
}
555+
<span class="macro">debug!</span>(<span class="string">"gc: done"</span>);
548556

549557
<span class="prelude-val">Ok</span>(())
550558
}
551559

552560
<span class="kw">pub async fn </span>run_gc(store: Store, config: GcConfig) {
561+
<span class="macro">debug!</span>(<span class="string">"gc enabled with interval {:?}"</span>, config.interval);
553562
<span class="kw">let </span><span class="kw-2">mut </span>live = HashSet::new();
554563
<span class="kw">loop </span>{
564+
live.clear();
555565
tokio::time::sleep(config.interval).<span class="kw">await</span>;
556566
<span class="kw">if let </span><span class="prelude-val">Some</span>(<span class="kw-2">ref </span>cb) = config.add_protected {
557567
<span class="kw">match </span>(cb)(<span class="kw-2">&amp;mut </span>live).<span class="kw">await </span>{

0 commit comments

Comments
 (0)