path to refreshing states from email that doesnt work over vpn

This commit is contained in:
Bel LaPointe
2022-01-09 23:42:53 -05:00
parent 485293466e
commit 366b35d76b
3 changed files with 40 additions and 6 deletions

21
main.go
View File

@@ -1,6 +1,7 @@
package main
import (
"errors"
"local/storage"
"local/truckstop/broker"
"local/truckstop/config"
@@ -9,11 +10,31 @@ import (
)
func main() {
go func() {
email()
c := time.NewTicker(time.Minute)
for range c.C {
if err := email(); err != nil {
log.Print(err)
}
}
}()
if err := _main(); err != nil {
panic(err)
}
}
func email() error {
ch, err := config.Get().Emailer.ReadIMAP()
if err != nil {
return err
}
for email := range ch {
log.Printf("%+v", email)
}
return errors.New("not impl")
}
func _main() error {
for {
if err := config.Refresh(); err != nil {