MCPcopy
hub / github.com/dgraph-io/dgraph / Close

Method Close

x/log_writer.go:126–144  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

124}
125
126func (l *LogWriter) Close() error {
127 if l == nil {
128 return nil
129 }
130 // close all go routines first before acquiring the lock to avoid contention
131 l.closer.SignalAndWait()
132
133 l.mu.Lock()
134 defer l.mu.Unlock()
135 if l.file == nil {
136 return nil
137 }
138 l.flush()
139 close(l.manageChannel)
140 _ = l.file.Close()
141 l.writer = nil
142 l.file = nil
143 return nil
144}
145
146// flushPeriodic periodically flushes the log file buffers.
147func (l *LogWriter) flushPeriodic() {

Callers 1

Calls 4

flushMethod · 0.95
CloseMethod · 0.65
LockMethod · 0.45
UnlockMethod · 0.45

Tested by 1