Skip to content

Commit 3a4ab4b

Browse files
committed
fix: socket reset
removes stale signals for already ended socket connections
1 parent da4912d commit 3a4ab4b

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

Diff for: main.go

+15-1
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@ func main() {
278278
fmt.Println(cs.Blue(logPrefix).Green("Compiled ").Cyan("\"" + basePath + "\"").Green(" to ").Cyan("\"" + outPath + "\"").String())
279279

280280
if *serveFlag {
281-
go watcher.StartWatching()
281+
watcher.StartWatching()
282282
runServer(*portFlag)
283283
}
284284

@@ -835,6 +835,7 @@ func _clientNotifyReload() {
835835
for ind := range reloadCh {
836836
reloadCh[ind] <- true
837837
}
838+
reloadCh = []chan bool{}
838839
}
839840

840841
func normalizeFilePath(path string) string {
@@ -891,18 +892,31 @@ func (w *Watcher) AddDir(dirPath string) {
891892
}
892893

893894
func (w *Watcher) RebuildAlvu() {
895+
onDebug(func() {
896+
debugInfo("Rebuild Started")
897+
})
894898
w.alvu.CopyPublic()
895899
w.alvu.Build()
900+
onDebug(func() {
901+
debugInfo("Build Completed")
902+
})
896903
}
897904

898905
func (w *Watcher) RebuildFile(filePath string) {
906+
onDebug(func() {
907+
debugInfo("RebuildFile Started")
908+
})
899909
for i, af := range w.alvu.files {
900910
if af.sourcePath != filePath {
901911
continue
902912
}
903913

904914
w.alvu.files[i].Build()
915+
break
905916
}
917+
onDebug(func() {
918+
debugInfo("RebuildFile Completed")
919+
})
906920
}
907921

908922
func (w *Watcher) StartWatching() {

0 commit comments

Comments
 (0)