From 019c9f16d74cfe85be782c67ec094d3b7c981152 Mon Sep 17 00:00:00 2001 From: dtookey Date: Tue, 3 May 2022 09:30:45 -0400 Subject: [PATCH] removed a hard coded date string in the UpdateTimeEntries method on the Interconnect struct --- src/insight/insight-connect.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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") +} + //