Skip to content

Commit 421904e

Browse files
committed
More cleanup.
1 parent 02b73b1 commit 421904e

File tree

3 files changed

+3
-14
lines changed

3 files changed

+3
-14
lines changed

frankenphp.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -477,10 +477,6 @@ func ServeHTTP(responseWriter http.ResponseWriter, request *http.Request) error
477477
return nil
478478
}
479479

480-
func handleRequest(thread *phpThread) {
481-
482-
}
483-
484480
func maybeCloseContext(fc *FrankenPHPContext) {
485481
fc.closed.Do(func() {
486482
close(fc.done)

main-thread.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ import (
77
"sync"
88
)
99

10+
// represents the main PHP thread
11+
// the thread needs to keep running as long as all other threads are running
1012
type mainPHPThread struct {
1113
state *threadState
1214
done chan struct{}

worker.go

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,11 @@ type worker struct {
2424

2525
var (
2626
workers map[string]*worker
27-
workersDone chan interface{}
2827
watcherIsEnabled bool
2928
)
3029

3130
func initWorkers(opt []workerOpt) error {
3231
workers = make(map[string]*worker, len(opt))
33-
workersDone = make(chan interface{})
3432
directoriesToWatch := getDirectoriesToWatch(opt)
3533
watcherIsEnabled = len(directoriesToWatch) > 0
3634

@@ -45,7 +43,7 @@ func initWorkers(opt []workerOpt) error {
4543
}
4644
}
4745

48-
if len(directoriesToWatch) == 0 {
46+
if !watcherIsEnabled {
4947
return nil
5048
}
5149

@@ -78,13 +76,8 @@ func newWorker(o workerOpt) (*worker, error) {
7876
return w, nil
7977
}
8078

81-
func stopWorkers() {
82-
close(workersDone)
83-
}
84-
8579
func drainWorkers() {
8680
watcher.DrainWatcher()
87-
stopWorkers()
8881
}
8982

9083
func restartWorkers() {
@@ -101,7 +94,6 @@ func restartWorkers() {
10194
}(thread)
10295
}
10396
}
104-
stopWorkers()
10597
ready.Wait()
10698
for _, worker := range workers {
10799
for _, thread := range worker.threads {
@@ -110,7 +102,6 @@ func restartWorkers() {
110102
}
111103
worker.threadMutex.RUnlock()
112104
}
113-
workersDone = make(chan interface{})
114105
}
115106

116107
func getDirectoriesToWatch(workerOpts []workerOpt) []string {

0 commit comments

Comments
 (0)