From f61470468ba0c98f70ef2cd5426a00c4c6f48fc6 Mon Sep 17 00:00:00 2001 From: Jeff Becker Date: Tue, 8 Aug 2017 18:45:51 -0400 Subject: [PATCH] add expire tool --- contrib/backends/srndv2/src/srnd/daemon.go | 6 ++++++ contrib/backends/srndv2/srnd.go | 3 +++ 2 files changed, 9 insertions(+) diff --git a/contrib/backends/srndv2/src/srnd/daemon.go b/contrib/backends/srndv2/src/srnd/daemon.go index 0166510..9445631 100644 --- a/contrib/backends/srndv2/src/srnd/daemon.go +++ b/contrib/backends/srndv2/src/srnd/daemon.go @@ -488,6 +488,12 @@ func (self *NNTPDaemon) syncPull(proxy_type, proxy_addr, remote_addr string) { } } +func (self *NNTPDaemon) ExpireAll() { + log.Println("expiring all orphans") + self.expire = createExpirationCore(self.database, self.store, self.informHooks) + self.expire.ExpireOrphans() +} + // run daemon func (self *NNTPDaemon) Run() { diff --git a/contrib/backends/srndv2/srnd.go b/contrib/backends/srndv2/srnd.go index d2cbc23..f8c5848 100644 --- a/contrib/backends/srndv2/srnd.go +++ b/contrib/backends/srndv2/srnd.go @@ -94,6 +94,9 @@ func main() { } else { fmt.Fprintf(os.Stdout, "usage: %s tool mod [[add|del] pubkey]|[do modactiongoeshere]\n", os.Args[0]) } + } else if tool == "expire" { + daemon.Setup() + daemon.ExpireAll() } else if tool == "rethumb" { if len(os.Args) >= 4 { threads := runtime.NumCPU()