mirror of
https://github.com/aljazceru/haven.git
synced 2025-12-18 22:24:22 +01:00
increase tagged import
This commit is contained in:
28
import.go
28
import.go
@@ -89,25 +89,19 @@ func importTaggedNotes() {
|
|||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, tag := range ev.Event.Tags.GetAll([]string{"p"}) {
|
wdb.Publish(ctx, *ev.Event)
|
||||||
if len(tag) < 2 {
|
taggedImportedNotes++
|
||||||
continue
|
}
|
||||||
}
|
|
||||||
if tag[1] == nPubToPubkey(config.OwnerNpub) {
|
|
||||||
wdb.Publish(ctx, *ev.Event)
|
|
||||||
taggedImportedNotes++
|
|
||||||
}
|
|
||||||
}
|
|
||||||
log.Println("📦 imported", taggedImportedNotes, "tagged notes")
|
|
||||||
time.Sleep(5 * time.Second)
|
|
||||||
|
|
||||||
startTime = startTime.Add(240 * time.Hour)
|
log.Println("📦 imported", taggedImportedNotes, "tagged notes")
|
||||||
endTime = endTime.Add(240 * time.Hour)
|
time.Sleep(5 * time.Second)
|
||||||
|
|
||||||
if startTime.After(time.Now()) {
|
startTime = startTime.Add(240 * time.Hour)
|
||||||
log.Println("✅ tagged import complete. please restart the relay")
|
endTime = endTime.Add(240 * time.Hour)
|
||||||
break
|
|
||||||
}
|
if startTime.After(time.Now()) {
|
||||||
|
log.Println("✅ tagged import complete. please restart the relay")
|
||||||
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user