Skip to content

Commit

Permalink
fix: socket reset
Browse files Browse the repository at this point in the history
removes stale signals for already ended socket connections
  • Loading branch information
barelyhuman committed Jul 11, 2023
1 parent da4912d commit 3a4ab4b
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ func main() {
fmt.Println(cs.Blue(logPrefix).Green("Compiled ").Cyan("\"" + basePath + "\"").Green(" to ").Cyan("\"" + outPath + "\"").String())

if *serveFlag {
go watcher.StartWatching()
watcher.StartWatching()
runServer(*portFlag)
}

Expand Down Expand Up @@ -835,6 +835,7 @@ func _clientNotifyReload() {
for ind := range reloadCh {
reloadCh[ind] <- true
}
reloadCh = []chan bool{}
}

func normalizeFilePath(path string) string {
Expand Down Expand Up @@ -891,18 +892,31 @@ func (w *Watcher) AddDir(dirPath string) {
}

func (w *Watcher) RebuildAlvu() {
onDebug(func() {
debugInfo("Rebuild Started")
})
w.alvu.CopyPublic()
w.alvu.Build()
onDebug(func() {
debugInfo("Build Completed")
})
}

func (w *Watcher) RebuildFile(filePath string) {
onDebug(func() {
debugInfo("RebuildFile Started")
})
for i, af := range w.alvu.files {
if af.sourcePath != filePath {
continue
}

w.alvu.files[i].Build()
break
}
onDebug(func() {
debugInfo("RebuildFile Completed")
})
}

func (w *Watcher) StartWatching() {
Expand Down

0 comments on commit 3a4ab4b

Please sign in to comment.