From 6e490a315754d6d8c283b8cf5641eb31fd5fc57f Mon Sep 17 00:00:00 2001 From: Tanmoy Sarkar <57363826+tanmoysrt@users.noreply.github.com> Date: Thu, 4 Jan 2024 14:40:25 +0530 Subject: [PATCH] chore: use set_value, get_value for cache --- frappe/push_notification.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/frappe/push_notification.py b/frappe/push_notification.py index 952d0f76e7..c4d205499e 100644 --- a/frappe/push_notification.py +++ b/frappe/push_notification.py @@ -194,7 +194,7 @@ class PushNotification: # Generate new credentials token = frappe.generate_hash(length=48) # store the token in the redis cache - frappe.cache().set(f"{self._get_site_name}:push_relay_registration_token", token, ex=600) + frappe.cache().set_value(f"{self._get_site_name}:push_relay_registration_token", token, ex=600) body = { "endpoint": self._get_site_name, "protocol": self._get_site_protocol, @@ -258,7 +258,7 @@ class PushNotification: # Webhook which will be called by the central relay server for authentication @frappe.whitelist(allow_guest=True, methods=["GET"]) def auth_webhook(): - token = frappe.cache().get(f"{frappe.local.site}:push_relay_registration_token") + token = frappe.cache().get_value(f"{frappe.local.site}:push_relay_registration_token") response = Response() response.mimetype = "text/plain; charset=UTF-8"