-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Description
Already tried to set this up for Raven3, but couldn't get it fully functional:
public async Task<bool> HideTimeouts(DateTime cutoffDate)
{
var cutoffDateParameter = cutoffDate.ToString("YYYY-MM-DDThh:mm:ssZ");
cutoffDateParameter = cutoffDateParameter.Replace(":", "\\:"); // escape characters for lucene
var dateRangeSpecification = $"Time:[{cutoffDateParameter} TO *]";
var patch = new Patch()
{
Script = $"this.OwningTimeoutManager = this.OwningTimeoutManager.substr({RavenConstants.MigrationOngoingPrefix.Length});",
Values = new { }
};
var patchCommand = JsonConvert.SerializeObject(patch);
var url = $"{serverUrl}/databases{databaseName}/bulk_docs/TimeoutsIndex?query={Uri.EscapeDataString(dateRangeSpecification)}&allowStale=false";
var encoded = Encoding.UTF8.GetBytes(patchCommand);
var compressed = Compress(encoded);
using var httpContent = new StringContent(Convert.ToBase64String(compressed), Encoding.UTF8, "application/json");
using var request = new HttpRequestMessage(new HttpMethod("EVAL"), url){ Content = httpContent};
var result = await httpClient.SendAsync(request);
return result.IsSuccessStatusCode;
}
Metadata
Metadata
Assignees
Labels
No labels