diff --git a/ingest/ingest.go b/ingest/ingest.go index a961c5d..f387b35 100644 --- a/ingest/ingest.go +++ b/ingest/ingest.go @@ -16,8 +16,6 @@ import ( "pool-stats/models" ) -const logsDir = "/home/pk/pro/pkstats/logs" - type Ingestor struct { db *clover.DB logPath string @@ -38,7 +36,7 @@ func (this *Ingestor) WatchAndIngest() { } func (this *Ingestor) ingestClosedBlocks() { - entries, err := os.ReadDir(logsDir) + entries, err := os.ReadDir(this.logPath) if err != nil { log.Println("Error reading logsDir:", err) return @@ -63,8 +61,8 @@ func (this *Ingestor) ingestClosedBlocks() { // Ingest all except last (current block dir) for _, dir := range blockDirs[:len(blockDirs)-1] { - this.ingestBlockDir(this.db, filepath.Join(logsDir, dir.Name())) - _ = os.RemoveAll(filepath.Join(logsDir, dir.Name())) + this.ingestBlockDir(this.db, filepath.Join(this.logPath, dir.Name())) + _ = os.RemoveAll(filepath.Join(this.logPath, dir.Name())) } }