Skip to content

Commit

Permalink
Smaller code cleanups
Browse files Browse the repository at this point in the history
  • Loading branch information
adrianrudnik committed Oct 31, 2023
1 parent 862b7c8 commit d6e26df
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 14 deletions.
2 changes: 1 addition & 1 deletion frontend/src/stores/base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import type { Ref } from 'vue'
import { computed, ref } from 'vue'

export interface StoreResource {
id: string
id: number | string
}

export function setupStore<T extends StoreResource>() {
Expand Down
2 changes: 0 additions & 2 deletions service/internal/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,6 @@ func LoadWithDefaults(path string) *Config {
// Create fallback configuration
c := newConfig()

Logger.Info().Err(err).Msg("Could not load config, falling back to defaults")

// For the searchable paths, we prefer the users home directory as initial configuration
homeDir, err := os.UserHomeDir()
if err == nil {
Expand Down
22 changes: 11 additions & 11 deletions service/internal/parser/worker.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,18 @@ import (
)

type WorkerPool struct {
workerCount int
inputPathsChan <-chan *pipeline2.FilesForProcessorMsg
outputResultChan chan<- *pipeline2.DocumentToIndexMsg
outputBroadcastChan chan<- interface{}
workerCount int
inputPathsChan <-chan *pipeline2.FilesForProcessorMsg
outputResultChan chan<- *pipeline2.DocumentToIndexMsg
pushChan chan<- interface{}
}

func NewWorkerPool(workerCount int, pathChan <-chan *pipeline2.FilesForProcessorMsg, resultChan chan<- *pipeline2.DocumentToIndexMsg, broadcastChan chan<- interface{}) *WorkerPool {
func NewWorkerPool(workerCount int, pathChan <-chan *pipeline2.FilesForProcessorMsg, resultChan chan<- *pipeline2.DocumentToIndexMsg, pushChan chan<- interface{}) *WorkerPool {
return &WorkerPool{
workerCount: workerCount,
inputPathsChan: pathChan,
outputResultChan: resultChan,
outputBroadcastChan: broadcastChan,
workerCount: workerCount,
inputPathsChan: pathChan,
outputResultChan: resultChan,
pushChan: pushChan,
}
}

Expand All @@ -40,13 +40,13 @@ func (p *WorkerPool) doWork(progress *stats.ProcessProgress, m *stats.Metrics) {
Logger.Warn().Err(err).Str("path", msg.AbsPath).Msg("Failed to parse file")

// Notify the UI about the failure
p.outputBroadcastChan <- pusher.NewFileStatusPush(msg.AbsPath, "failed", err.Error())
p.pushChan <- pusher.NewFileStatusPush(msg.AbsPath, "failed", err.Error())

continue
}

// Notify the UI about the file progress
p.outputBroadcastChan <- pusher.NewFileStatusPush(msg.AbsPath, "processed", "")
p.pushChan <- pusher.NewFileStatusPush(msg.AbsPath, "processed", "")

Logger.Debug().Str("path", msg.AbsPath).Msg("Finished processing")

Expand Down

0 comments on commit d6e26df

Please sign in to comment.