We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 72cb268 commit df3b006Copy full SHA for df3b006
internal/api/handlers/management/logs.go
@@ -116,7 +116,7 @@ func (h *Handler) DeleteLogs(c *gin.Context) {
116
name := entry.Name()
117
fullPath := filepath.Join(dir, name)
118
if name == defaultLogFileName {
119
- if errTrunc := os.Truncate(fullPath, 0); errTrunc != nil {
+ if errTrunc := os.Truncate(fullPath, 0); errTrunc != nil && !os.IsNotExist(errTrunc) {
120
c.JSON(http.StatusInternalServerError, gin.H{"error": fmt.Sprintf("failed to truncate log file: %v", errTrunc)})
121
return
122
}
0 commit comments