MCPcopy Create free account
hub / github.com/AandStep/ResultV / initAdBlockFilters

Method initAdBlockFilters

app.go:1186–1202  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1184}
1185
1186func (a *App) initAdBlockFilters() {
1187 if a.ctx == nil || a.filters == nil {
1188 return
1189 }
1190 go func() {
1191 ctx, cancel := context.WithTimeout(a.ctx, 2*time.Minute)
1192 defer cancel()
1193 if a.filters.NeedsUpdate() {
1194 if err := a.filters.Update(ctx, a.emitAdBlockProgress); err != nil {
1195 a.log.Warning(fmt.Sprintf("[ADBLOCK] Фоновое обновление баз: %v", err))
1196 } else {
1197 a.log.Info("[ADBLOCK] Базы блокировки обновлены при запуске")
1198 }
1199 }
1200 }()
1201 a.startAdBlockFilterRefresh()
1202}
1203
1204func (a *App) startAdBlockFilterRefresh() {
1205 if a.ctx == nil || a.filters == nil {

Callers 1

startupMethod · 0.95

Calls 5

NeedsUpdateMethod · 0.80
UpdateMethod · 0.80
WarningMethod · 0.65
InfoMethod · 0.65

Tested by

no test coverage detected