Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FEAT: Add Server Restart reason #58

Open
HilkopterBob opened this issue Oct 7, 2024 · 4 comments
Open

FEAT: Add Server Restart reason #58

HilkopterBob opened this issue Oct 7, 2024 · 4 comments
Assignees
Labels
good first issue Good for newcomers New Feature For new Features
Milestone

Comments

@HilkopterBob
Copy link
Owner

Add a message channel to push a restart reason into the server Go-Routine, so we can print it out to the user and or logs

We need to touch following code:

PackageLock/main.go

Lines 26 to 30 in e756cce

var (
restartChan = make(chan struct{})
quitChan = make(chan os.Signal, 1)
AppVersion string // Version injected with ldflags
)

and:

PackageLock/main.go

Lines 226 to 247 in e756cce

case <-restartChan:
fmt.Println("Restarting Fiber server...")
_, cancel := context.WithTimeout(context.Background(), 5*time.Second)
defer cancel()
if err := router.Router.Shutdown(); err != nil {
fmt.Printf("Server shutdown failed: %v\n", err)
} else {
fmt.Println("Server stopped.")
}
startServer()
case <-quitChan:
fmt.Println("Shutting down Fiber server...")
_, cancel := context.WithTimeout(context.Background(), 5*time.Second)
defer cancel()
if err := router.Router.Shutdown(); err != nil {
fmt.Printf("Server shutdown failed: %v\n", err)
} else {
fmt.Println("Server stopped gracefully.")
}
return
}

Do you want to look into that @Kartoffel096 ?

@saxenaaman628
Copy link

saxenaaman628 commented Oct 7, 2024

@HilkopterBob, Hi can I contribute to this?

@HilkopterBob
Copy link
Owner Author

Yes absolutely! But keep in mind this project is in its early stages. But other than that your work is greatly appreciated!

@saxenaaman628
Copy link

Hi, Is there any group channel, Where I can directly connect with you? and ask questions.

@HilkopterBob
Copy link
Owner Author

You can join the discord 👾
https://discord.gg/CUFv3PU3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers New Feature For new Features
Projects
None yet
Development

No branches or pull requests

3 participants