changeset 3510:f09423c29f31

mod_pubsub_github: Log debug message before attempting to publish This data is probably more useful in case of a traceback than after completing successfully
author Kim Alvefur <zash@zash.se>
date Sun, 31 Mar 2019 16:11:37 +0200
parents 94414cadfcaa
children b583cce491de
files mod_pubsub_github/mod_pubsub_github.lua
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mod_pubsub_github/mod_pubsub_github.lua	Sun Mar 31 16:07:11 2019 +0200
+++ b/mod_pubsub_github/mod_pubsub_github.lua	Sun Mar 31 16:11:37 2019 +0200
@@ -26,6 +26,8 @@
 		return "Invalid JSON. From you of all people...";
 	end
 
+	module:log("debug", "Handling POST: \n%s\n", tostring(request.body));
+
 	for _, commit in ipairs(data.commits) do
 		local ok, err = pubsub_service:publish(node, true, data.repository.name,
 			st.stanza("item", { id = data.repository.name, xmlns = "http://jabber.org/protocol/pubsub" })
@@ -44,7 +46,6 @@
 		end
 	end
 
-	module:log("debug", "Handled POST: \n%s\n", tostring(request.body));
 	response.status_code = 202;
 	return "Thank you Github!";
 end