This commit is contained in:
@@ -5,7 +5,9 @@ import (
|
||||
"fmt"
|
||||
"log"
|
||||
"net/http"
|
||||
"os"
|
||||
"sync"
|
||||
"time"
|
||||
)
|
||||
|
||||
var (
|
||||
@@ -37,8 +39,25 @@ func getOrCreateStepManager(userID string) *StepManager {
|
||||
return sm
|
||||
}
|
||||
|
||||
func initTimezone() {
|
||||
tz := os.Getenv("TZ")
|
||||
if tz != "" {
|
||||
loc, err := time.LoadLocation(tz)
|
||||
if err != nil {
|
||||
log.Printf("Error loading timezone %s: %v. Using UTC.", tz, err)
|
||||
return
|
||||
}
|
||||
time.Local = loc
|
||||
log.Printf("Timezone set to %s", tz)
|
||||
} else {
|
||||
log.Printf("TZ environment variable not set, using system default (usually UTC)")
|
||||
}
|
||||
log.Printf("Current system time: %s", time.Now().Format(time.RFC1123Z))
|
||||
}
|
||||
|
||||
func main() {
|
||||
// Initialize components
|
||||
initTimezone()
|
||||
InitFitbit()
|
||||
InitUserRegistry()
|
||||
InitVoteRegistry()
|
||||
|
||||
Reference in New Issue
Block a user