MCPcopy Create free account
hub / github.com/1Panel-dev/1Panel / Write

Method Write

core/log/writer.go:199–216  ·  view source on GitHub ↗
(b []byte)

Source from the content-addressed store, hash-verified

197}
198
199func (w *Writer) Write(b []byte) (int, error) {
200 var ok = false
201 for !ok {
202 select {
203 case filename := <-w.fire:
204 if err := w.Reopen(filename); err != nil {
205 return 0, err
206 }
207 default:
208 ok = true
209 }
210 }
211
212 select {
213 case w.queue <- b:
214 return len(b), nil
215 }
216}
217
218func (w *Writer) Reopen(file string) error {
219 fileInfo, err := w.file.Stat()

Callers 7

ExportCommandsFunction · 0.95
InitFunction · 0.45
setStaticResourceFunction · 0.45
onCloseMethod · 0.45
writerMethod · 0.45
GenerateMD5Function · 0.45
handleMuxHttpConnFunction · 0.45

Calls 1

ReopenMethod · 0.95

Tested by

no test coverage detected