This commit is contained in:
Dmytro 2023-11-08 17:02:30 +03:00 committed by GitHub
parent 97f00a1433
commit 466031ab8f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 5 deletions

View File

@ -29,7 +29,8 @@ func (d *DiagnosticClient) Setup() {
func (d *DiagnosticClient) runSnapshotListener() {
go func() {
ctx, ch, _ /*cancel*/ := diaglib.Context[diaglib.DownloadStatistics](context.Background(), 1)
ctx, ch, cancel := diaglib.Context[diaglib.DownloadStatistics](context.Background(), 1)
defer cancel()
rootCtx, _ := common.RootContext()
@ -37,6 +38,7 @@ func (d *DiagnosticClient) runSnapshotListener() {
for {
select {
case <-rootCtx.Done():
cancel()
return
case info := <-ch:
d.snapshotDownload[info.StagePrefix] = info

View File

@ -184,10 +184,6 @@ func WaitForDownloader(logPrefix string, ctx context.Context, histV3 bool, capli
defer logEvery.Stop()
var m runtime.MemStats
/*diagnostics.RegisterProvider(diagnostics.ProviderFunc(func(ctx context.Context) error {
return nil
}), diagnostics.TypeOf(diagnostics.DownloadStatistics{}), log.Root())*/
// Check once without delay, for faster erigon re-start
stats, err := snapshotDownloader.Stats(ctx, &proto_downloader.StatsRequest{})
if err == nil && stats.Completed {