diff src/luan/modules/host/Hosting.luan @ 1381:8d7a39ca2c0c

add Rpc in_backup_read_lock
author Franklin Schmidt <fschmidt@gmail.com>
date Sun, 28 Jul 2019 20:15:38 -0600
parents ae2321a09723
children 5b8f76e26ab7
line wrap: on
line diff
--- a/src/luan/modules/host/Hosting.luan	Sun Jul 28 11:06:37 2019 -0600
+++ b/src/luan/modules/host/Hosting.luan	Sun Jul 28 20:15:38 2019 -0600
@@ -10,6 +10,8 @@
 local Rpc = require "luan:Rpc.luan"
 local String = require "luan:String.luan"
 local matches = String.matches or error()
+local Logging = require "luan:logging/Logging.luan"
+local logger = Logging.logger "Hosting"
 
 
 local Hosting = {}
@@ -21,6 +23,7 @@
 	my_dir.is_directory() or error("'"..dir.."' is not a directory")
 	local host = Rpc.remote(domain)
 	local tree = host.get(domain,password)
+	host.in_backup_read_lock()
 	if tree == nil then
 		print("creating "..domain)
 		tree = host.create(domain,password)
@@ -64,6 +67,7 @@
 
 function Hosting.delete(domain,password)
 	local host = Rpc.remote(domain)
+	host.in_backup_read_lock()
 	host.delete(domain,password)
 	host.close()
 end
@@ -77,6 +81,7 @@
 
 function Hosting.change_domain(old_domain,new_domain,password)
 	local host = Rpc.remote(new_domain)
+	host.in_backup_read_lock()
 	local rtn = host.change_domain(old_domain,new_domain,password)
 	host.close()
 	return rtn
@@ -84,6 +89,7 @@
 
 function Hosting.change_password(domain,old_password,new_password)
 	local host = Rpc.remote(domain)
+	host.in_backup_read_lock()
 	local rtn = host.change_password(domain,old_password,new_password)
 	host.close()
 	return rtn