Class: Typesense::ImportJob
- Inherits:
-
ActiveJob::Base
- Object
- ActiveJob::Base
- Typesense::ImportJob
- Defined in:
- lib/typesense/import_job.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.perform(jsonl_object, collection_name, batch_size) ⇒ Object
5 6 7 |
# File 'lib/typesense/import_job.rb', line 5 def self.perform(jsonl_object, collection_name, batch_size) new.perform_later(jsonl_object, collection_name, batch_size) end |
Instance Method Details
#perform_later(jsonl_object, collection_name, batch_size) ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/typesense/import_job.rb', line 9 def perform_later(jsonl_object, collection_name, batch_size) # Initialize client with longer timeout for batch operations client = Typesense::Client.new(Typesense.configuration.merge( connection_timeout_seconds: 3600, )) client.collections[collection_name].documents.import(jsonl_object, { action: "upsert", batch_size: batch_size, }) end |