로그 수정

This commit is contained in:
2023-11-24 00:18:04 +09:00
parent e583904693
commit ba4b4eea94
4 changed files with 11 additions and 21 deletions

2
go.mod
View File

@ -7,7 +7,7 @@ require (
github.com/golang-jwt/jwt v3.2.2+incompatible github.com/golang-jwt/jwt v3.2.2+incompatible
go.mongodb.org/mongo-driver v1.11.7 go.mongodb.org/mongo-driver v1.11.7
google.golang.org/api v0.128.0 google.golang.org/api v0.128.0
repositories.action2quare.com/ayo/gocommon v0.0.0-20231116105647-72a62b678f83 repositories.action2quare.com/ayo/gocommon v0.0.0-20231123013925-8adef2adb814
) )
require ( require (

4
go.sum
View File

@ -268,5 +268,5 @@ gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
repositories.action2quare.com/ayo/gocommon v0.0.0-20231116105647-72a62b678f83 h1:0X/ZTLb71JQ+ksZyPdLkxAHz9nDTT+/qRjV/zYBzlMc= repositories.action2quare.com/ayo/gocommon v0.0.0-20231123013925-8adef2adb814 h1:3K7YBlNbm7AJJLt8LJ2iDHxgJG5vL7hE1VvdG7VwKCM=
repositories.action2quare.com/ayo/gocommon v0.0.0-20231116105647-72a62b678f83/go.mod h1:XvklTTSvQX5uviivGBcZo8eIL+mV94W2e4uBBXcT5JY= repositories.action2quare.com/ayo/gocommon v0.0.0-20231123013925-8adef2adb814/go.mod h1:XvklTTSvQX5uviivGBcZo8eIL+mV94W2e4uBBXcT5JY=

12
main.go
View File

@ -21,23 +21,27 @@ func main() {
logger.Println("build revision =", revision) logger.Println("build revision =", revision)
ctx, cancel := context.WithCancel(context.Background()) ctx, cancel := context.WithCancel(context.Background())
defer cancel()
mg, err := core.New(ctx) mg, err := core.New(ctx)
if err != nil { if err != nil {
logger.Error("core.New failed :", err) logger.Error("core.New failed :", err)
panic(err) return
} }
defer mg.Destructor()
serveMux := http.NewServeMux() serveMux := http.NewServeMux()
if err := mg.RegisterHandlers(ctx, serveMux, *prefix); err != nil { if err := mg.RegisterHandlers(ctx, serveMux, *prefix); err != nil {
logger.Error("RegisterHandlers failed :", err) logger.Error("RegisterHandlers failed :", err)
panic(err) return
} }
server := gocommon.NewHTTPServer(serveMux) server := gocommon.NewHTTPServer(serveMux)
logger.Println("maingate is started") logger.Println("maingate is started")
if err := server.Start(); err != nil { if err := server.Start(); err != nil {
logger.Error("maingate is stopped with error :", err) logger.Error("maingate is stopped with error :", err)
} }
cancel()
mg.Destructor() logger.Println("maingate is terminated")
} }

View File

@ -1,14 +0,0 @@
# $ErrorActionPreference = 'SilentlyContinue'
$CurBranch = git branch --show-current
Remove-Item maingate.zip -Force -Recurse -ErrorAction SilentlyContinue
$Env:GOOS="linux"
$Env:GOARCH="amd64"
go build -ldflags="-s -w" .
Compress-Archive -Path maingate -Update -DestinationPath maingate.zip
Compress-Archive -Path *-firebase-*.json -Update -DestinationPath maingate.zip
Compress-Archive -Path fba -Update -DestinationPath maingate.zip
Compress-Archive -Path template -Update -DestinationPath maingate.zip