Removed debugging lines from GetTimeAllTimeEntriesForUserThroughDate, but kept the non-200 response code debugging line.

Modified insight-connect.go to only capture time entry data from engineering users.
Added line for updating some finance info into the main mercury.go routine, but it's commented out until the delivery pipeline gets sorted out.
master
dtookey 4 years ago
parent c7e92d9fa0
commit 791ca84414

@ -4,7 +4,7 @@ cd /opt/go/src/mercury || exit
rm build/*
go build -o ./build/mercury ./src
go build -o ./build/mercury ./src/mercury.go
mercury_qb_path="/home/dtookey/work/clarity-reporting/qb/" DB_CREDS="$(cat /home/dtookey/work/datastudio-db-creds.txt)" DB_HOST=data-connect.carolina.engineering ./build/mercury

@ -35,6 +35,7 @@ func updateInsightData() {
icx.Init()
icx.UpdateUsers()
icx.UpdateTimeEntries()
//finance.GenerateArAgingReport("/home/dtookey/work/clarity-reporting/qb/ar/")
}
func processQbBilling() {

@ -112,6 +112,7 @@ func (iClient *InsightClient) GetTimeAllTimeEntriesForUserThroughDate(userId str
container := make([]*InsightTimeEntry, 0, 1000) //do we want to make the default result size parametric?
err := json.Unmarshal(*rawBytes, &container)
if err != nil {
log.Printf("Error with following string: %s\n", string(*rawBytes))
log.Panic(err)
}
returnChan <- &container
@ -146,7 +147,6 @@ func (iClient *InsightClient) getRawUsers() *[]*InsightUser {
req := iClient.createRequest(userEndpoint, insightTokenFile)
rawBytes := iClient.doGet(req)
container := make([]*InsightUser, 0, 150) //do we want to make the default result size parametric?
log.Println(string(*rawBytes))
err := json.Unmarshal(*rawBytes, &container)
if err != nil {
log.Panic(err)
@ -161,6 +161,10 @@ func (iClient *InsightClient) doGet(req *http.Request) *[]byte {
log.Panic(err)
}
if resp.StatusCode != 200 {
log.Printf("Got non-200 response from request: %s\t%d", req.URL, resp.StatusCode)
}
bodyBytes, err := ioutil.ReadAll(resp.Body)
if err != nil {
log.Panic(err)

@ -78,7 +78,7 @@ func (c *InsightDBConnector) ReadUsers() *[]*InsightUser {
return db.QueryForObjects[InsightUser](
c.ConnectorGeneric,
db.InsightDatabaseName,
"read-insight-allUsers.sql",
"read-insight-engineerUsers.sql",
insightUserMappingFunction,
)
}

Loading…
Cancel
Save