mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2025-12-16 12:09:13 +08:00
fix: correct suitable log queue size to improve performance (#11008)
* fix: Update log queue size to improve performance and ensure proper handling of log entries * fix: Adjust log queue size to maintain consistency with queue size limit
This commit is contained in:
parent
217d780ed1
commit
8656dada06
2 changed files with 6 additions and 3 deletions
|
|
@ -2,10 +2,11 @@ package log
|
|||
|
||||
import (
|
||||
"errors"
|
||||
"github.com/1Panel-dev/1Panel/core/constant"
|
||||
"io"
|
||||
"os"
|
||||
"path"
|
||||
|
||||
"github.com/1Panel-dev/1Panel/core/constant"
|
||||
)
|
||||
|
||||
var (
|
||||
|
|
@ -14,6 +15,7 @@ var (
|
|||
DefaultFileFlag = os.O_RDWR | os.O_CREATE | os.O_APPEND
|
||||
ErrInvalidArgument = errors.New("error argument invalid")
|
||||
QueueSize = 1024
|
||||
LogQueueSize = 1024
|
||||
ErrClosed = errors.New("error write on close")
|
||||
)
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
package log
|
||||
|
||||
import (
|
||||
"github.com/1Panel-dev/1Panel/core/constant"
|
||||
"log"
|
||||
"os"
|
||||
"path"
|
||||
|
|
@ -11,6 +10,8 @@ import (
|
|||
"sync/atomic"
|
||||
"time"
|
||||
|
||||
"github.com/1Panel-dev/1Panel/core/constant"
|
||||
|
||||
"github.com/1Panel-dev/1Panel/core/global"
|
||||
)
|
||||
|
||||
|
|
@ -98,7 +99,7 @@ func NewWriterFromConfig(c *Config) (RollingWriter, error) {
|
|||
|
||||
var rollingWriter RollingWriter
|
||||
writer := Writer{
|
||||
queue: make(chan []byte, BufferSize),
|
||||
queue: make(chan []byte, LogQueueSize),
|
||||
m: mng,
|
||||
file: file,
|
||||
absPath: filepath,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue