Skip to content

Commit

Permalink
Merge pull request #393 from yashsinghcodes/new
Browse files Browse the repository at this point in the history
append actual value in set_cache
  • Loading branch information
yashsinghcodes authored Jan 10, 2025
2 parents 913a04a + 91e6177 commit 5fce896
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
4 changes: 2 additions & 2 deletions shuffle-tools/1.2.0/run.sh
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Build testing
NAME=frikky/shuffle:shuffle-tools_1.1.0
NAME=frikky/shuffle:shuffle-tools_1.2.0
docker rmi $NAME --force
docker build . -t frikky/shuffle:shuffle-tools_1.1.0
docker build . -t frikky/shuffle:shuffle-tools_1.2.0

# Run testing
#docker run -e SHUFFLE_SWARM_CONFIG=run -e SHUFFLE_APP_EXPOSED_PORT=33334 frikky/shuffle:shuffle-tools_1.1.0
Expand Down
9 changes: 8 additions & 1 deletion shuffle-tools/1.2.0/src/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -1981,7 +1981,14 @@ def check_cache_contains(self, key, value, append):
allvalues["value"].append(value)
exception = ""
try:
# FIXME: This is a hack, but it works
if directcall:
new_value = parsedvalue
if new_value == None:
new_value = [value]

data["value"] = json.dumps(new_value)

set_url = "%s/api/v1/orgs/%s/set_cache" % (self.url, org_id)
response = requests.post(set_url, json=data, verify=False)
allvalues = response.json()
Expand All @@ -1991,7 +1998,7 @@ def check_cache_contains(self, key, value, append):
return {
"success": True,
"found": False,
"reason": "Appended as it didn't exist",
"reason": f"Appended as it didn't exist",
"key": key,
"search": value,
"value": parsedvalue,
Expand Down

0 comments on commit 5fce896

Please sign in to comment.