App
- 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:
parent
4cbca297b3
commit
0fdaba47ad
21
source/app.d
21
source/app.d
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue