Mercurial Hosting > luan
diff src/luan/modules/lucene/Lucene.luan @ 1408:5b8f76e26ab7
remove old backups
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Tue, 24 Sep 2019 15:02:33 -0600 |
parents | 9882c053d26f |
children | c7f9dd062eda |
line wrap: on
line diff
--- a/src/luan/modules/lucene/Lucene.luan Fri Sep 20 17:00:30 2019 -0600 +++ b/src/luan/modules/lucene/Lucene.luan Tue Sep 24 15:02:33 2019 -0600 @@ -13,7 +13,6 @@ local Thread = require "luan:Thread.luan" local schedule = Thread.schedule or error() local run_in_lock = Thread.run_in_lock or error() -local backup_read_lock = Thread.backup_read_lock or error() local Time = require "luan:Time.luan" local Rpc = require "luan:Rpc.luan" local LuceneIndex = require "java:luan.modules.lucene.LuceneIndex" @@ -151,19 +150,6 @@ end ) end - function index.schedule_backups_to(backup_dir,repeating_delay) - local lucene_dir = index.dir - local function backup() - if backup_dir.last_modified() < lucene_dir.last_modified() then - run_in_lock(backup_read_lock, index.backup_to,backup_dir) - logger.info "backup" - end - end - schedule( backup, { - repeating_delay = repeating_delay or Time.period{minutes=10} - } ) - end - function index.zip(zip_file) index.snapshot( function(dir_path,file_names) zip_file.delete() @@ -220,14 +206,4 @@ return index end -function Lucene.recover(index_dir,restore_dir) - if not index_dir.exists() and restore_dir.exists() then - index_dir.mkdir() - for _, child in ipairs(restore_dir.children()) do - index_dir.child(child.name()).link_to(child) - end - logger.error "recovered" - end -end - return Lucene