Skip to content

Commit

Permalink
Merge pull request #392 from yashsinghcodes/new
Browse files Browse the repository at this point in the history
This should fix the, appending problem in cache if value does not exists.
  • Loading branch information
yashsinghcodes authored Jan 10, 2025
2 parents d4f3916 + ba30a0c commit 913a04a
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions shuffle-tools/1.2.0/src/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -1816,6 +1816,7 @@ def check_cache_contains(self, key, value, append):
"search": str(value),
"key": key,
}
directcall = False

allvalues = {}
try:
Expand Down Expand Up @@ -1859,6 +1860,7 @@ def check_cache_contains(self, key, value, append):
if "success" not in allvalues:
get_response = requests.post(url, json=data, verify=False)
allvalues = get_response.json()
directcall = True

try:
if allvalues["value"] == None or allvalues["value"] == "null":
Expand Down Expand Up @@ -1977,11 +1979,13 @@ def check_cache_contains(self, key, value, append):
if value not in allvalues["value"] and isinstance(allvalues["value"], list):
self.cache_update_buffer.append(value)
allvalues["value"].append(value)
#set_url = "%s/api/v1/orgs/%s/set_cache" % (self.url, org_id)
#response = requests.post(set_url, json=data, verify=False)
exception = ""
try:
#allvalues = response.json()
if directcall:
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()

#return allvalues

return {
Expand Down

0 comments on commit 913a04a

Please sign in to comment.