func fetch(t time.Time, inbox chan<- *store.Bucket) { fmt.Printf("at=start_fetch minute=%d\n", t.Minute()) mailbox := fmt.Sprintf("librato_outlet.%d", partitionId) for bucket := range store.ScanBuckets(mailbox) { inbox <- bucket } }
func fetch(t time.Time, outbox chan<- *store.Bucket) { fmt.Printf("at=start_fetch minute=%d\n", t.Minute()) defer utils.MeasureT("postgres_outlet.fetch", time.Now()) mailbox := fmt.Sprintf("postgres_outlet.%d", partitionId) for bucket := range store.ScanBuckets(mailbox) { outbox <- bucket } }
func fetch(t time.Time, inbox chan<- *store.Bucket) { pid, err := utils.LockPartition("librato_outlet", numPartitions, lockTTL) if err != nil { log.Fatal("Unable to lock partition.") } fmt.Printf("at=start_fetch minute=%d\n", t.Minute()) mailbox := fmt.Sprintf("librato_outlet.%d", pid) for bucket := range store.ScanBuckets(mailbox) { inbox <- bucket } }
func fetch(t time.Time, outbox chan<- *store.Bucket) { fmt.Printf("at=start_fetch minute=%d\n", t.Minute()) defer utils.MeasureT("postgres_outlet.fetch", time.Now()) pid, err := utils.LockPartition("postgres_outlet", numPartitions, lockTTL) if err != nil { log.Fatal("Unable to lock partition.") } mailbox := fmt.Sprintf("postgres_outlet.%d", pid) for bucket := range store.ScanBuckets(mailbox) { outbox <- bucket } }