Mercurial Hosting > luan
comparison src/luan/modules/lucene/Lucene.luan @ 1763:164c6ea53147
fix change_password
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Mon, 22 May 2023 19:21:14 -0600 |
parents | d1e7564a9ce5 |
children | c62324841dfb |
comparison
equal
deleted
inserted
replaced
1762:7d2297155ee3 | 1763:164c6ea53147 |
---|---|
5 local pairs = Luan.pairs or error() | 5 local pairs = Luan.pairs or error() |
6 local type = Luan.type or error() | 6 local type = Luan.type or error() |
7 local set_metatable = Luan.set_metatable or error() | 7 local set_metatable = Luan.set_metatable or error() |
8 local get_local_cloned = Luan.get_local_cloned | 8 local get_local_cloned = Luan.get_local_cloned |
9 local set_local_cloned = Luan.set_local_cloned | 9 local set_local_cloned = Luan.set_local_cloned |
10 local pairs_local_cloned = Luan.pairs_local_cloned | |
10 local Boot = require "luan:Boot.luan" | 11 local Boot = require "luan:Boot.luan" |
11 local Html = require "luan:Html.luan" | 12 local Html = require "luan:Html.luan" |
12 local Number = require "luan:Number.luan" | 13 local Number = require "luan:Number.luan" |
13 local integer = Number.integer or error() | 14 local integer = Number.integer or error() |
14 local Time = require "luan:Time.luan" | 15 local Time = require "luan:Time.luan" |
28 | 29 |
29 local indexes = {} | 30 local indexes = {} |
30 local indexes_mt = { | 31 local indexes_mt = { |
31 __index = get_local_cloned | 32 __index = get_local_cloned |
32 __new_index = set_local_cloned | 33 __new_index = set_local_cloned |
34 __pairs = pairs_local_cloned | |
33 } | 35 } |
34 set_metatable(indexes,indexes_mt) | 36 set_metatable(indexes,indexes_mt) |
35 | 37 |
36 function Rpc.functions.lucene_backup(password,name) | 38 function Rpc.functions.lucene_backup(password,name) |
37 Io.password == password or error "wrong password" | 39 Io.password == password or error "wrong password" |
233 index.save(doc) | 235 index.save(doc) |
234 end ) | 236 end ) |
235 end | 237 end |
236 end | 238 end |
237 | 239 |
240 index.close_down = java_index.close_down | |
241 | |
238 return index | 242 return index |
239 end | 243 end |
240 | 244 |
245 function Rpc.functions.close_lucene(password) | |
246 Io.password == password or error "wrong password" | |
247 logger.info("close_all") | |
248 for name, index in pairs(indexes) do | |
249 logger.info("closing "..name) | |
250 index.close_down() | |
251 end | |
252 end | |
253 | |
241 return Lucene | 254 return Lucene |