Skip to content

Commit 8a16f20

Browse files
authored
Revert back the code changes in #436 and #443 (#445)
* Revert back the code changes in #436 and #443 * Docker restart always
1 parent 9285b8a commit 8a16f20

File tree

3 files changed

+4
-5
lines changed

3 files changed

+4
-5
lines changed

Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ run-collector: clone-tnf-secrets stop-running-collector-container
9898

9999
# Runs collector on rds with docker
100100
run-collector-rds: clone-tnf-secrets stop-running-collector-container
101-
docker run -d --pull always -p ${HOST_PORT}:${TARGET_PORT} --name ${COLLECTOR_CONTAINER_NAME} \
101+
docker run --restart always -d --pull always -p ${HOST_PORT}:${TARGET_PORT} --name ${COLLECTOR_CONTAINER_NAME} \
102102
-e DB_USER='$(shell jq -r ".MysqlUsername" "./tnf-secrets/collector-secrets.json" | base64 -d)' \
103103
-e DB_PASSWORD='$(shell jq -r ".MysqlPassword" "./tnf-secrets/collector-secrets.json" | base64 -d)' \
104104
-e DB_URL='${DB_URL}' \

api/server.go

+2-3
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,10 @@ func NewServer(listenAddr string, db *storage.MySQLStorage, objectStore *storage
2727
}
2828
}
2929

30-
func (s *Server) Start() {
30+
func (s *Server) Start() error {
3131
logrus.Info("Starting server")
3232
http.HandleFunc("/", s.handler)
33-
//nolint:errcheck
34-
s.server.ListenAndServe()
33+
return s.server.ListenAndServe()
3534
}
3635

3736
func (s *Server) handler(w http.ResponseWriter, r *http.Request) {

main.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,5 +23,5 @@ func main() {
2323
server := api.NewServer(addr, mysqlStore, s3Store,
2424
time.Duration(readTimeOut)*time.Second, time.Duration(writeTimeOut)*time.Second)
2525

26-
server.Start()
26+
logrus.Fatal(server.Start())
2727
}

0 commit comments

Comments
 (0)