That shutdown function needs to call this....
Added nice little delay to give time for the XML-RPC response to go back to the grid manager when shutting downzircon^2
parent
e42c10fee5
commit
06734abf5f
|
@ -2,7 +2,7 @@ using System;
|
||||||
using System.Collections;
|
using System.Collections;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using Nwc.XmlRpc;
|
using Nwc.XmlRpc;
|
||||||
|
using System.Threading;
|
||||||
|
|
||||||
namespace OpenGrid.Framework.Manager {
|
namespace OpenGrid.Framework.Manager {
|
||||||
|
|
||||||
|
@ -19,18 +19,21 @@ namespace OpenGrid.Framework.Manager {
|
||||||
Hashtable requestData = (Hashtable)request.Params[0];
|
Hashtable requestData = (Hashtable)request.Params[0];
|
||||||
Hashtable responseData = new Hashtable();
|
Hashtable responseData = new Hashtable();
|
||||||
|
|
||||||
if((string)requestData["authkey"] != recvkey) {
|
responseData["msg"]="Shutdown command accepted";
|
||||||
responseData["error"]="INVALID KEY";
|
(new Thread(new ThreadStart(ZOMGServerIsNowTerminallyIll))).Start();
|
||||||
} else {
|
|
||||||
responseData["msg"]="Shutdown command accepted";
|
|
||||||
responseData["authkey"]=sendkey;
|
|
||||||
thecallback("shutdown");
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
response.Value = responseData;
|
response.Value = responseData;
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Brought to by late-night coding
|
||||||
|
public static void ZOMGServerIsNowTerminallyIll()
|
||||||
|
{
|
||||||
|
Console.WriteLine("ZOMG! THIS SERVER IS TERMINALLY ILL - WE GOT A SHUTDOWN REQUEST FROM A GRID MANAGER!!!!");
|
||||||
|
Console.WriteLine("We have 3 seconds to live...");
|
||||||
|
Thread.Sleep(3000);
|
||||||
|
thecallback("shutdown");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue