Thanks to visit codestin.com
Credit goes to github.com

Skip to content

kuroski/pguard

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Graceful Runner

A small Go utility that runs a command with optional timeout and graceful shutdown handling.

Usage

go run main.go [flags] <command> [args...]

Flags

Flag Type Description
-timeout duration (Optional) Maximum allowed time for the command to run. e.g. 30s, 2m.
-graceful duration (Optional) Time to wait after SIGINT before killing the process. e.g. 5s

Note: Use negative values to disable timeout or graceful shutdown respectively.

Example

pguard -timeout=10s -graceful=3s sleep 100

This will:

  • Run sleep 100
  • Timeout after 10 seconds
  • If interrupted (Ctrl+C), give it 3 seconds to exit before forcefully killing it

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages