Skip to content

Commit 2755a57

Browse files
committed
Update once per week, include date updated in results
1 parent b14cc0b commit 2755a57

File tree

3 files changed

+8
-2
lines changed

3 files changed

+8
-2
lines changed

.github/workflows/gcr-deploy.yaml

+4-2
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,12 @@ on:
55
branches:
66
- main
77

8+
# every Monday at 00:42
9+
schedule:
10+
- cron: "42 0 * * 1"
11+
812
workflow_dispatch:
913

10-
# Environment variables available to all jobs and steps in this workflow
11-
# NOTE: these aren't really secret, but there aren't non-secret settings
1214
env:
1315
RUN_PROJECT: ${{ secrets.RUN_PROJECT }}
1416
RUN_REGION: ${{ secrets.RUN_REGION }}

apiHandler.go

+2
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ type ApiResponse struct {
99
Input string `json:"input"`
1010
Rank int `json:"rank"`
1111
Notice string `json:"notice"`
12+
AsOf string `json:"as_of"`
1213
}
1314

1415
func apiHandler(w http.ResponseWriter, r *http.Request) {
@@ -42,6 +43,7 @@ func apiHandler(w http.ResponseWriter, r *http.Request) {
4243
return
4344
}
4445

46+
retVal.AsOf = rankDate
4547
retVal.Success = true
4648
retVal.Message = "OK"
4749
retVal.Rank = rank

multiHandler.go

+2
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ type MultiResponse struct {
1212
Results map[string]int `json:"results"`
1313
Messages []string `json:"messages"`
1414
Notice string `json:"notice"`
15+
AsOf string `json:"as_of"`
1516
}
1617

1718
var re = regexp.MustCompile("[ ,\t\n\r]+")
@@ -56,6 +57,7 @@ func multiHandler(w http.ResponseWriter, r *http.Request) {
5657
}
5758
}
5859

60+
retVal.AsOf = rankDate
5961
retVal.Success = true
6062
retVal.Message = "OK"
6163

0 commit comments

Comments
 (0)