feat(worker): support graceful shutdown (#459)

* feat(worker): support graceful shutdown

notifications workers and queue have been sent to APNs/FCM before shutdown a push notification.

send buffered channel to signal.Notify to avoid blocking

see: golang/lint#175

fixed: https://github.com/appleboy/gorush/issues/441

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
This commit is contained in:
Bo-Yi Wu
2020-02-04 13:27:27 +08:00
committed by GitHub
parent bcf1c0cd03
commit 2d2a8a0110
10 changed files with 76 additions and 21 deletions

View File

@@ -137,7 +137,7 @@ build_linux_lambda:
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -a -tags 'lambda' -ldflags '$(EXTLDFLAGS)-s -w $(LDFLAGS)' -o release/linux/lambda/$(DEPLOY_IMAGE)
docker_image:
docker build -t $(DEPLOY_ACCOUNT)/$(DEPLOY_IMAGE) -f Dockerfile .
docker build -t $(DEPLOY_ACCOUNT)/$(DEPLOY_IMAGE) -f ./docker/Dockerfile.linux.amd64 .
docker_release: docker_image