Class: Legion::Extensions::Knowledge::Actor::CorpusWatcher

Inherits:
Actors::Every
  • Object
show all
Defined in:
lib/legion/extensions/knowledge/actors/corpus_watcher.rb

Instance Method Summary collapse

Instance Method Details

#argsObject



29
30
31
# File 'lib/legion/extensions/knowledge/actors/corpus_watcher.rb', line 29

def args
  { path: corpus_path }
end

#check_subtask?Boolean

Returns:

  • (Boolean)


10
# File 'lib/legion/extensions/knowledge/actors/corpus_watcher.rb', line 10

def check_subtask?  = false

#enabled?Boolean

Returns:

  • (Boolean)


23
24
25
26
27
# File 'lib/legion/extensions/knowledge/actors/corpus_watcher.rb', line 23

def enabled?
  corpus_path && !corpus_path.empty?
rescue StandardError
  false
end

#every_intervalObject



13
14
15
16
17
18
19
20
21
# File 'lib/legion/extensions/knowledge/actors/corpus_watcher.rb', line 13

def every_interval
  if defined?(Legion::Settings) && !Legion::Settings[:knowledge].nil?
    Legion::Settings.dig(:knowledge, :actors, :watcher_interval) || 300
  else
    300
  end
rescue StandardError
  300
end

#generate_task?Boolean

Returns:

  • (Boolean)


11
# File 'lib/legion/extensions/knowledge/actors/corpus_watcher.rb', line 11

def generate_task?  = false

#runner_classObject



8
# File 'lib/legion/extensions/knowledge/actors/corpus_watcher.rb', line 8

def runner_class    = 'Legion::Extensions::Knowledge::Runners::Ingest'

#runner_functionObject



9
# File 'lib/legion/extensions/knowledge/actors/corpus_watcher.rb', line 9

def runner_function = 'ingest_corpus'