Skip to content

Commit

Permalink
upd
Browse files Browse the repository at this point in the history
  • Loading branch information
guillaume-chervet committed Nov 8, 2023
1 parent 0a6a672 commit 6686b2a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/SlimData/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ await context.Response.WriteAsync(queueCount.ToString(InvariantCulture),
break;
}

if (string.IsNullOrEmpty(key) || int.TryParse(value, out int count))
if (string.IsNullOrEmpty(key) || !int.TryParse(value, out int count))
{
context.Response.StatusCode = StatusCodes.Status400BadRequest;
await context.Response.WriteAsync("Key key is empty or value is not a number",
Expand Down
6 changes: 3 additions & 3 deletions src/SlimFaas/Database/SlimDataService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,10 @@ public async Task SetAsync(string key, string value)
public async Task HashSetAsync(string key, IDictionary<string, string> values)
{
var multipart = new MultipartFormDataContent();
multipart.Add(new StringContent("______key_____"), key);
multipart.Add(new StringContent(key), "______key_____");
foreach (KeyValuePair<string,string> value in values)
{
multipart.Add(new StringContent(value.Key), value.Value);
multipart.Add(new StringContent(value.Value), value.Key);
}

var response = await _httpClient.PostAsync(new Uri("http://localhost:3262/AddHashset"), multipart);
Expand All @@ -53,7 +53,7 @@ public async Task<IList<string>> ListRightPopAsync(string key, long count = 1)
{
var request = new HttpRequestMessage(HttpMethod.Post, new Uri("http://localhost:3262/ListRightPop"));
var multipart = new MultipartFormDataContent();
multipart.Add(new StringContent(key), count.ToString());
multipart.Add(new StringContent(count.ToString()), key);

request.Content = multipart;
var response = await _httpClient.SendAsync(request);
Expand Down

0 comments on commit 6686b2a

Please sign in to comment.