refactor: improve code readability and maintainability across multiple files
- Reformatted function signatures for better clarity in media.go and onvif-quick/main.go. - Replaced hardcoded values with constants in ascii.go and server/imaging.go for improved maintainability. - Enhanced error handling and logging consistency in onvif-diagnostics/main.go and server/server.go. - Updated comments to clarify functionality and ensure adherence to ONVIF specifications across various files.
This commit is contained in:
+2
-1
@@ -160,7 +160,8 @@ func (s *Server) Start(ctx context.Context) error {
|
||||
select {
|
||||
case <-ctx.Done():
|
||||
fmt.Println("\n🛑 Shutting down server...")
|
||||
shutdownCtx, cancel := context.WithTimeout(context.Background(), 5*time.Second)
|
||||
const shutdownTimeout = 5 //nolint:mnd // Server shutdown timeout in seconds
|
||||
shutdownCtx, cancel := context.WithTimeout(context.Background(), shutdownTimeout*time.Second)
|
||||
defer cancel()
|
||||
|
||||
if err := httpServer.Shutdown(shutdownCtx); err != nil {
|
||||
|
||||
Reference in New Issue
Block a user