lib/fts_lite/index.rb in fts_lite-0.1.1 vs lib/fts_lite/index.rb in fts_lite-0.1.2
- old
+ new
@@ -4,10 +4,11 @@
class Index
DEFAULT_TOKENIZER = :bigram
DEFAULT_JURNAL_MODE = "MEMORY"
DEFAULT_TEMP_STORE = "MEMORY"
DEFAULT_CACHE_SIZE = 32000
+ DEFAULT_TIMEOUT = 10000
SQLITE_HAVE_FT4_REPLACE = SQLite3.libversion >= 3007007
def self.have_ft4_replace
SQLITE_HAVE_FT4_REPLACE
end
@@ -125,9 +126,10 @@
def set_db_param(options)
@db.transaction do
@db.execute("PRAGMA journal_mode=#{options[:journal_mode] || DEFAULT_JURNAL_MODE};")
@db.execute("PRAGMA temp_store=#{options[:temp_store] || DEFAULT_TEMP_STORE};")
@db.execute("PRAGMA cache_size=#{options[:cache_size] || DEFAULT_CACHE_SIZE};")
+ @db.busy_timeout = options[:timeout] || DEFAULT_TIMEOUT
end
end
end
end