示例#1
0
    public static string StopRemovingAttachmentHistory()
    {
        AttachmentHistoryRemover.Stop();

        return(js.Serialize(new
        {
            Success = true,
            AttachmentHistoryRemover.Running,
        }));
    }
示例#2
0
    public static string GetAttachmentHistoryRemoverProgress()
    {
        var messages = string.Join("\n", AttachmentHistoryRemover.DumpProgress().ToArray().Reverse()) + "\n";

        var progress = new
        {
            AttachmentHistoryRemover.Running,
            Messages = string.IsNullOrWhiteSpace(messages) ? string.Empty : messages,
        };

        return(js.Serialize(progress));
    }
示例#3
0
    public static string StartRemovingAttachmentHistory(int daysBeforeLastModified, int maxAllowedVersions)
    {
        try
        {
            AttachmentHistoryRemover.Start(daysBeforeLastModified, maxAllowedVersions);

            return(js.Serialize(new
            {
                Success = true,
                Running = true,
            }));
        }
        catch (Exception e)
        {
            return(js.Serialize(new {
                Success = false,
                e.Message,
            }));
        }
    }