diff prosodyctl @ 14080:973609bad40a

util.time: Import sleep from luasocket We might not want to use the full LuaSocket for such a tiny function which will never change. This drops win32 support but that should be fine.
author Link Mauve <linkmauve@linkmauve.fr>
date Fri, 30 Jan 2026 14:08:53 +0100
parents af28d6debaca
children 7c9fd032c788
line wrap: on
line diff
--- a/prosodyctl	Fri Jan 30 14:44:04 2026 +0100
+++ b/prosodyctl	Fri Jan 30 14:08:53 2026 +0100
@@ -65,13 +65,13 @@
 local configmanager = require "prosody.core.configmanager";
 local modulemanager = require "prosody.core.modulemanager"
 local prosodyctl = require "prosody.util.prosodyctl"
-local socket = require "socket"
 local dependencies = require "prosody.util.dependencies";
 local lfs = dependencies.softreq "lfs";
 
 -----------------------
 
 local parse_args = require "prosody.util.argparse".parse;
+local sleep = require "prosody.util.time".sleep;
 local human_io = require "prosody.util.human.io";
 
 local show_message, show_warning = prosodyctl.show_message, prosodyctl.show_warning;
@@ -265,7 +265,7 @@
 					show_message("Prosody is still not running. Please give it some time or check your log files for errors.");
 					return 2;
 				end
-				socket.sleep(0.5);
+				sleep(0.5);
 				i = i + 1;
 			end
 			show_message("Started");
@@ -346,7 +346,7 @@
 				show_message("Prosody is still running. Please give it some time or check your log files for errors.");
 				return 2;
 			end
-			socket.sleep(0.5);
+			sleep(0.5);
 			i = i + 1;
 		end
 		show_message("Stopped");
@@ -456,6 +456,7 @@
 		-- These diverge from the module._VERSION convention
 		readline = "Version";
 	}
+	local socket = dependencies.softreq"socket";
 	local lunbound = dependencies.softreq"lunbound";
 	local lxp = dependencies.softreq"lxp";
 	local hashes = dependencies.softreq"prosody.util.hashes";