diff --git a/src/insight/insight-connect.go b/src/insight/insight-connect.go index 820f0b0..c51a684 100644 --- a/src/insight/insight-connect.go +++ b/src/insight/insight-connect.go @@ -122,8 +122,9 @@ func (ic *Interconnect) UpdateTimeEntries() { users := ic.DBConnector.FetchUsers() entryChan := make(chan *[]*TimeEntry) coroutineCount := 0 + dateString := createDateString() for _, userPtr := range *users { - go ic.Client.GetTimeAllTimeEntriesForUserThroughDate(userPtr.Id, "2022-04-28", entryChan) + go ic.Client.GetTimeAllTimeEntriesForUserThroughDate(userPtr.Id, dateString, entryChan) coroutineCount++ time.Sleep(1000 * time.Millisecond) } @@ -257,4 +258,9 @@ func cacheTokens() *map[string]string { return &ret } +func createDateString() string { + now := time.Now() + return now.Format("2006-01-02") +} + //