This commit is contained in:
natan
2024-03-26 18:32:56 +01:00
parent b8151b1ddf
commit 5d53eddb32
62 changed files with 1267 additions and 362 deletions
@@ -24,7 +24,7 @@ using System.Collections.Generic;
namespace Duplicati.Server.WebServer.RESTMethods
{
public class ServerState : IRESTMethodGET, IRESTMethodPOST, IRESTMethodDocumented
public class ServerState : IRESTMethodPOST, IRESTMethodDocumented
{
public void GET(string key, RequestInfo info)
{
@@ -32,16 +32,17 @@ namespace Duplicati.Server.WebServer.RESTMethods
long id = 0;
long.TryParse(key, out id);
var serverStatus = new Serializable.ServerStatus();
if (info.LongPollCheck(FIXMEGlobal.StatusEventNotifyer, ref id, out isError))
{
//Make sure we do not report a higher number than the eventnotifier says
var st = new Serializable.ServerStatus();
var st = serverStatus;
st.LastEventID = id;
info.OutputOK(st);
}
else if (!isError)
{
info.OutputOK(new Serializable.ServerStatus());
info.OutputOK(serverStatus);
}
}