1
0
Fork 0
mirror of https://github.com/postmannen/ctrl.git synced 2024-12-14 12:37:31 +00:00

Only keep last hello from node in data folder

This commit is contained in:
postmannen 2022-01-04 07:50:14 +01:00
parent c4aa08711a
commit fe6af5c841

View file

@ -953,7 +953,8 @@ func (m methodREQHello) handler(proc process, message Message, node string) ([]b
// Open file and write data.
file := filepath.Join(folderTree, fileName)
f, err := os.OpenFile(file, os.O_APPEND|os.O_RDWR|os.O_CREATE|os.O_SYNC, 0600)
//f, err := os.OpenFile(file, os.O_APPEND|os.O_RDWR|os.O_CREATE|os.O_SYNC, 0600)
f, err := os.OpenFile(file, os.O_TRUNC|os.O_RDWR|os.O_CREATE|os.O_SYNC, 0600)
if err != nil {
log.Printf("error: methodREQHello.handler: failed to open file: %v\n", err)