@rivascva/dt-idl 1.1.179 → 1.1.180

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/go/srv/srv.go +3 -9
  2. package/package.json +1 -1
package/go/srv/srv.go CHANGED
@@ -13,8 +13,7 @@ import (
13
13
 
14
14
  // ListenAndServe starts the HTTP server and blocks until the context is cancelled.
15
15
  // It then gracefully shuts down allowing in-flight requests to complete.
16
- // The onShutdown functions are called after the server stops to clean up resources.
17
- func ListenAndServe(ctx context.Context, log log.Logger, srv *http.Server, onShutdown []func()) {
16
+ func ListenAndServe(ctx context.Context, log log.Logger, srv *http.Server) {
18
17
  // start the server in a separate goroutine
19
18
  go func() {
20
19
  log.Info(ctx, fmt.Sprintf("server running on %s", srv.Addr))
@@ -28,18 +27,13 @@ func ListenAndServe(ctx context.Context, log log.Logger, srv *http.Server, onShu
28
27
  log.Info(ctx, "shutting down gracefully...")
29
28
 
30
29
  // give in-flight requests time to complete
31
- shutdownCtx, cancel := utils.DetachContext(ctx, 10*time.Second)
30
+ detachedCtx, cancel := utils.DetachContext(ctx, 10*time.Second)
32
31
  defer cancel()
33
32
 
34
33
  // shutdown the server
35
- if err := srv.Shutdown(shutdownCtx); err != nil {
34
+ if err := srv.Shutdown(detachedCtx); err != nil {
36
35
  log.Error(ctx, err)
37
36
  }
38
37
 
39
- // run cleanup functions
40
- for _, fn := range onShutdown {
41
- fn()
42
- }
43
-
44
38
  log.Info(ctx, "server stopped")
45
39
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rivascva/dt-idl",
3
- "version": "1.1.179",
3
+ "version": "1.1.180",
4
4
  "description": "Dream Trade - Interface Definition Language",
5
5
  "main": "dist/index.cjs.js",
6
6
  "module": "dist/index.esm.js",