Add spider functionality for relay crawling, marker management, and new SpiderMode config.
- Introduced the `spider` package for relay crawling, including periodic tasks and one-time sync capabilities. - Added `SetMarker`, `GetMarker`, `HasMarker`, and `DeleteMarker` methods in the database for marker management. - Updated configuration with `SpiderMode` and `SpiderFrequency` options to enable and customize spider behavior. - Integrated `spider` initialization into the main application flow. - Improved tag handling, NIP-70 compliance, and protected tag validation in event processing. - Removed unnecessary logging and replaced `errorf` with `fmt.Errorf` for better error handling. - Incremented version to `v0.5.0`.
This commit is contained in:
7
main.go
7
main.go
@@ -18,6 +18,7 @@ import (
|
||||
"next.orly.dev/app/config"
|
||||
"next.orly.dev/pkg/acl"
|
||||
"next.orly.dev/pkg/database"
|
||||
"next.orly.dev/pkg/spider"
|
||||
"next.orly.dev/pkg/version"
|
||||
)
|
||||
|
||||
@@ -158,6 +159,12 @@ func main() {
|
||||
}
|
||||
acl.Registry.Syncer()
|
||||
|
||||
// Initialize and start spider functionality if enabled
|
||||
spiderCtx, spiderCancel := context.WithCancel(ctx)
|
||||
spiderInstance := spider.New(db, cfg, spiderCtx, spiderCancel)
|
||||
spiderInstance.Start()
|
||||
defer spiderInstance.Stop()
|
||||
|
||||
// Start HTTP pprof server if enabled
|
||||
if cfg.PprofHTTP {
|
||||
pprofAddr := fmt.Sprintf("%s:%d", cfg.Listen, 6060)
|
||||
|
||||
Reference in New Issue
Block a user