- If we have an error, always check the state of the bot and based on that try reconnect -
CURRENTLY UNSAFE and multiple can realise this and then try
This commit is contained in:
Tristan B. Velloza Kildaire 2023-07-05 13:19:50 +02:00
parent 4cbca297b3
commit 0fdaba47ad
1 changed files with 21 additions and 0 deletions

View File

@ -82,6 +82,13 @@ void commitHandler(HTTPServerRequest request, HTTPServerResponse response)
{
replyCode=500;
replyJSON["output"]=e.toString();
/* Check if we are not running, then to reconnect */
// FIXME: Currently unsafe!
if(ircBot.isRunning() == false)
{
ircBot.connect();
}
}
response.writeJsonBody(replyJSON, 200);
@ -181,6 +188,13 @@ void issueHandler(HTTPServerRequest request, HTTPServerResponse response)
{
replyCode=500;
replyJSON["output"]=e.toString();
/* Check if we are not running, then to reconnect */
// FIXME: Currently unsafe!
if(ircBot.isRunning() == false)
{
ircBot.connect();
}
}
response.writeJsonBody(replyJSON, 200);
@ -205,6 +219,13 @@ void pullRequestHandler(HTTPServerRequest request, HTTPServerResponse response)
{
replyCode=500;
replyJSON["output"]=e.toString();
/* Check if we are not running, then to reconnect */
// FIXME: Currently unsafe!
if(ircBot.isRunning() == false)
{
ircBot.connect();
}
}
response.writeJsonBody(replyJSON, 200);