Skip to content

Commit

Permalink
go: return exit code 143: Graceful Termination (SIGTERM)
Browse files Browse the repository at this point in the history
Signed-off-by: Victor Login <batazor@evrone.com>
  • Loading branch information
batazor committed Mar 29, 2023
1 parent c31ce2d commit 37804b8
Show file tree
Hide file tree
Showing 8 changed files with 39 additions and 0 deletions.
5 changes: 5 additions & 0 deletions internal/services/api/cmd/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ API-service
package main

import (
"os"

"github.com/spf13/viper"

"github.com/shortlink-org/shortlink/internal/pkg/handle_signal"
Expand All @@ -34,4 +36,7 @@ func main() {
handle_signal.WaitExitSignal()

cleanup()

// Exit Code 143: Graceful Termination (SIGTERM)
os.Exit(143)
}
5 changes: 5 additions & 0 deletions internal/services/billing/cmd/billing.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ Billing-service
package main

import (
"os"

"github.com/spf13/viper"

"github.com/shortlink-org/shortlink/internal/pkg/handle_signal"
Expand All @@ -31,4 +33,7 @@ func main() {
handle_signal.WaitExitSignal()

cleanup()

// Exit Code 143: Graceful Termination (SIGTERM)
os.Exit(143)
}
4 changes: 4 additions & 0 deletions internal/services/csi/cmd/csi.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package main
import (
"fmt"
"log"
"os"

"github.com/shortlink-org/shortlink/internal/pkg/handle_signal"
csi_di "github.com/shortlink-org/shortlink/internal/services/csi/di"
Expand Down Expand Up @@ -77,4 +78,7 @@ func main() {

// Stop the service gracefully.
cleanup()

// Exit Code 143: Graceful Termination (SIGTERM)
os.Exit(143)
}
5 changes: 5 additions & 0 deletions internal/services/link/cmd/link.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ Link-service
package main

import (
"os"

"github.com/shortlink-org/shortlink/internal/pkg/handle_signal"
link_di "github.com/shortlink-org/shortlink/internal/services/link/di"
"github.com/spf13/viper"
Expand All @@ -30,4 +32,7 @@ func main() {
handle_signal.WaitExitSignal()

cleanup()

// Exit Code 143: Graceful Termination (SIGTERM)
os.Exit(143)
}
5 changes: 5 additions & 0 deletions internal/services/logger/cmd/logger.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ Logger-service
package main

import (
"os"

"github.com/shortlink-org/shortlink/internal/pkg/handle_signal"
logger_di "github.com/shortlink-org/shortlink/internal/services/logger/di"
"github.com/spf13/viper"
Expand All @@ -30,4 +32,7 @@ func main() {
handle_signal.WaitExitSignal()

cleanup()

// Exit Code 143: Graceful Termination (SIGTERM)
os.Exit(143)
}
5 changes: 5 additions & 0 deletions internal/services/metadata/cmd/metadata.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ Get information by links
package main

import (
"os"

"github.com/shortlink-org/shortlink/internal/pkg/handle_signal"
metadata_di "github.com/shortlink-org/shortlink/internal/services/metadata/di"
"github.com/spf13/viper"
Expand All @@ -31,4 +33,7 @@ func main() {

// Stop the service gracefully.
cleanup()

// Exit Code 143: Graceful Termination (SIGTERM)
os.Exit(143)
}
5 changes: 5 additions & 0 deletions internal/services/notify/cmd/notify.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ Bot application
package main

import (
"os"

"github.com/shortlink-org/shortlink/internal/pkg/handle_signal"
notify_di "github.com/shortlink-org/shortlink/internal/services/notify/di"
"github.com/spf13/viper"
Expand All @@ -29,4 +31,7 @@ func main() {

// Stop the service gracefully.
cleanup()

// Exit Code 143: Graceful Termination (SIGTERM)
os.Exit(143)
}
5 changes: 5 additions & 0 deletions internal/services/wallet/cmd/wallet.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ Wallet-service
package main

import (
"os"

"github.com/shortlink-org/shortlink/internal/pkg/handle_signal"
wallet_di "github.com/shortlink-org/shortlink/internal/services/wallet/di"
"github.com/spf13/viper"
Expand All @@ -30,4 +32,7 @@ func main() {
handle_signal.WaitExitSignal()

cleanup()

// Exit Code 143: Graceful Termination (SIGTERM)
os.Exit(143)
}

0 comments on commit 37804b8

Please sign in to comment.