Select the types of activity you want to include in your feed.
indexserver: PAUSE file to stop indexserver (#140)
PAUSE if present in IndexDir will stop index jobs from running. This is
to make it possible to experiment with the content of the IndexDir
without the indexserver writing to it.
···239239 return repoName
240240}
241241242242+// pauseFileName if present in IndexDir will stop index jobs from
243243+// running. This is to make it possible to experiment with the content of the
244244+// IndexDir without the indexserver writing to it.
245245+const pauseFileName = "PAUSE"
246246+242247// Run the sync loop. This blocks forever.
243248func (s *Server) Run(queue *Queue) {
244249 removeIncompleteShards(s.IndexDir)
···246251 // Start a goroutine which updates the queue with commits to index.
247252 go func() {
248253 for range jitterTicker(s.Interval) {
254254+ if b, err := os.ReadFile(filepath.Join(s.IndexDir, pauseFileName)); err == nil {
255255+ log.Printf("indexserver manually paused via PAUSE file: %s", string(bytes.TrimSpace(b)))
256256+ continue
257257+ }
258258+249259 repos, err := s.Sourcegraph.ListRepos(context.Background(), listIndexed(s.IndexDir))
250260 if err != nil {
251261 log.Println(err)
···306316307317 // In the current goroutine process the queue forever.
308318 for {
319319+ if _, err := os.Stat(filepath.Join(s.IndexDir, pauseFileName)); err == nil {
320320+ time.Sleep(time.Second)
321321+ continue
322322+ }
323323+309324 name, opts, ok := queue.Pop()
310325 if !ok {
311326 time.Sleep(time.Second)