mirror of
https://github.com/0xJacky/nginx-ui.git
synced 2025-05-12 10:55:51 +02:00
fix: implement context handling in analytic and processing functions for graceful shutdown
This commit is contained in:
parent
710b9f781e
commit
fc507ccd3b
4 changed files with 24 additions and 3 deletions
|
@ -8,6 +8,7 @@ import (
|
|||
"github.com/0xJacky/Nginx-UI/api"
|
||||
"github.com/0xJacky/Nginx-UI/internal/cache"
|
||||
"github.com/0xJacky/Nginx-UI/internal/cert"
|
||||
"github.com/0xJacky/Nginx-UI/internal/kernel"
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
|
@ -58,6 +59,8 @@ func GetProcessingStatus(c *gin.Context) {
|
|||
c.SSEvent("heartbeat", "")
|
||||
return false
|
||||
})
|
||||
case <-kernel.Context.Done():
|
||||
return
|
||||
case <-notify:
|
||||
// Client disconnected
|
||||
return
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue