mirror of
https://github.com/aljazceru/crawler_v2.git
synced 2025-12-17 07:24:21 +01:00
changed shutdown messages
This commit is contained in:
@@ -60,7 +60,7 @@ func Arbiter(ctx context.Context, config ArbiterConfig, db redb.RedisDB, send fu
|
|||||||
for {
|
for {
|
||||||
select {
|
select {
|
||||||
case <-ctx.Done():
|
case <-ctx.Done():
|
||||||
log.Println("Arbiter: shutting down...")
|
log.Println("Arbiter: shut down")
|
||||||
return
|
return
|
||||||
|
|
||||||
case <-ticker.C:
|
case <-ticker.C:
|
||||||
|
|||||||
@@ -52,7 +52,7 @@ func Engine(
|
|||||||
defer close(graphEvents)
|
defer close(graphEvents)
|
||||||
|
|
||||||
log.Println("Engine: ready to process events")
|
log.Println("Engine: ready to process events")
|
||||||
defer log.Println("Engine: shutting down...")
|
defer log.Println("Engine: shut down")
|
||||||
|
|
||||||
go GraphBuilder(ctx, config, db, graphEvents)
|
go GraphBuilder(ctx, config, db, graphEvents)
|
||||||
|
|
||||||
|
|||||||
@@ -100,7 +100,7 @@ func (b *buffer) Contains(ID string) bool {
|
|||||||
// Firehose connects to a list of relays and pulls config.Kinds events that are newer than [FirehoseConfig.Since].
|
// Firehose connects to a list of relays and pulls config.Kinds events that are newer than [FirehoseConfig.Since].
|
||||||
// It discards events from unknown pubkeys as an anti-spam mechanism.
|
// It discards events from unknown pubkeys as an anti-spam mechanism.
|
||||||
func Firehose(ctx context.Context, config FirehoseConfig, check PubkeyChecker, send func(*nostr.Event) error) {
|
func Firehose(ctx context.Context, config FirehoseConfig, check PubkeyChecker, send func(*nostr.Event) error) {
|
||||||
defer log.Println("Firehose: shutting down...")
|
defer log.Println("Firehose: shut down")
|
||||||
|
|
||||||
pool := nostr.NewSimplePool(ctx)
|
pool := nostr.NewSimplePool(ctx)
|
||||||
defer shutdown(pool)
|
defer shutdown(pool)
|
||||||
@@ -162,7 +162,7 @@ func (c FetcherConfig) Print() {
|
|||||||
// - when the batch is bigger than config.Batch
|
// - when the batch is bigger than config.Batch
|
||||||
// - after config.Interval since the last query.
|
// - after config.Interval since the last query.
|
||||||
func Fetcher(ctx context.Context, config FetcherConfig, pubkeys <-chan string, send func(*nostr.Event) error) {
|
func Fetcher(ctx context.Context, config FetcherConfig, pubkeys <-chan string, send func(*nostr.Event) error) {
|
||||||
defer log.Println("Fetcher: shutting down...")
|
defer log.Println("Fetcher: shut down")
|
||||||
|
|
||||||
batch := make([]string, 0, config.Batch)
|
batch := make([]string, 0, config.Batch)
|
||||||
timer := time.After(config.Interval)
|
timer := time.After(config.Interval)
|
||||||
@@ -262,7 +262,7 @@ func FetcherDB(
|
|||||||
pubkeys <-chan string,
|
pubkeys <-chan string,
|
||||||
send func(*nostr.Event) error) {
|
send func(*nostr.Event) error) {
|
||||||
|
|
||||||
defer log.Println("FetcherDB: shutting down...")
|
defer log.Println("FetcherDB: shut down")
|
||||||
|
|
||||||
batch := make([]string, 0, config.Batch)
|
batch := make([]string, 0, config.Batch)
|
||||||
timer := time.After(config.Interval)
|
timer := time.After(config.Interval)
|
||||||
|
|||||||
Reference in New Issue
Block a user