reach_commons 0.15.7__py3-none-any.whl → 0.15.9__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- reach_commons/reach_aws/sqs.py +14 -0
- reach_commons/redis_manager.py +15 -0
- {reach_commons-0.15.7.dist-info → reach_commons-0.15.9.dist-info}/METADATA +1 -1
- {reach_commons-0.15.7.dist-info → reach_commons-0.15.9.dist-info}/RECORD +5 -5
- {reach_commons-0.15.7.dist-info → reach_commons-0.15.9.dist-info}/WHEEL +0 -0
reach_commons/reach_aws/sqs.py
CHANGED
|
@@ -473,6 +473,20 @@ class SmsProcessorSQSNotifier(SQSClient):
|
|
|
473
473
|
delay_seconds=delay_seconds,
|
|
474
474
|
)
|
|
475
475
|
|
|
476
|
+
def notify_for_republish_sms(self, message_data):
|
|
477
|
+
delay_seconds = message_data.get("delay_seconds", 60)
|
|
478
|
+
|
|
479
|
+
if "delay_seconds" in message_data:
|
|
480
|
+
delay_seconds *= 2
|
|
481
|
+
|
|
482
|
+
message_attributes = {"service_name": self.SERVICE_NAME}
|
|
483
|
+
|
|
484
|
+
return self.publish(
|
|
485
|
+
message_data=message_data,
|
|
486
|
+
message_attributes=message_attributes,
|
|
487
|
+
delay_seconds=delay_seconds,
|
|
488
|
+
)
|
|
489
|
+
|
|
476
490
|
|
|
477
491
|
class POSApiPullerSQSNotifier(SQSClient):
|
|
478
492
|
SERVICE_NAME = "POSApiPullerSQSNotifier"
|
reach_commons/redis_manager.py
CHANGED
|
@@ -55,3 +55,18 @@ class RedisManager:
|
|
|
55
55
|
|
|
56
56
|
def delete(self, key):
|
|
57
57
|
self.redis_connection.delete(key)
|
|
58
|
+
|
|
59
|
+
def set(self, name, value, nx=False, ex=None):
|
|
60
|
+
"""
|
|
61
|
+
Sets a key-value pair in Redis with optional constraints.
|
|
62
|
+
|
|
63
|
+
Parameters:
|
|
64
|
+
- name (str): The key name to set in Redis.
|
|
65
|
+
- value (str): The value to store under the key.
|
|
66
|
+
- nx (bool): If True, sets the key only if it does not already exist (used for locking).
|
|
67
|
+
- ex (int | None): Expiration time in seconds. If provided, the key will automatically expire.
|
|
68
|
+
|
|
69
|
+
Returns:
|
|
70
|
+
- bool: True if the key was set successfully, False otherwise (especially when nx=True and key already exists).
|
|
71
|
+
"""
|
|
72
|
+
return self.redis_connection.set(name=name, value=value, nx=nx, ex=ex)
|
|
@@ -21,12 +21,12 @@ reach_commons/reach_aws/exceptions.py,sha256=x0RL5ktNtzxg0KykhEVWReBq_dEtciK6B2v
|
|
|
21
21
|
reach_commons/reach_aws/firehose.py,sha256=1xFKLWMv3bNo3PPW5gtaL6NqzUDyVil6B768slj2wbY,5674
|
|
22
22
|
reach_commons/reach_aws/kms.py,sha256=HDJ3lnKm6Jah2asizUDtQErlVSjrcV9lOfBPHzUVguY,4526
|
|
23
23
|
reach_commons/reach_aws/s3.py,sha256=KLWvlQVakaaGfFg3110QHc1PlxCb1pUhmJQ-VggLEj4,1962
|
|
24
|
-
reach_commons/reach_aws/sqs.py,sha256=
|
|
24
|
+
reach_commons/reach_aws/sqs.py,sha256=LKQ42vRJko2HTE8gO_lRvftnstIMI3DeFZakvLUM0BQ,15864
|
|
25
25
|
reach_commons/reach_base_model.py,sha256=uMmDGjwKTZ3h7f8Pfvc99FCsAt5eZNlUJnLLbB5EqGY,2907
|
|
26
|
-
reach_commons/redis_manager.py,sha256=
|
|
26
|
+
reach_commons/redis_manager.py,sha256=tK-kBw1fO1f-phsxGI-7W_MEtHQsRz7JY9LEN8OBcNY,2600
|
|
27
27
|
reach_commons/sms_smart_encoding.py,sha256=81byimk8zydNsj1wYdYsF4n96Lw4GQOBmKOu-GiYY9s,993
|
|
28
28
|
reach_commons/utils.py,sha256=dMgKIGqTgoSItuBI8oz81gKtW3qi21Jkljv9leS_V88,8475
|
|
29
29
|
reach_commons/validations.py,sha256=jc78boM62S9Z0Ip_nV1z7I983gGpW2Y7vOCQtmia8OU,964
|
|
30
|
-
reach_commons-0.15.
|
|
31
|
-
reach_commons-0.15.
|
|
32
|
-
reach_commons-0.15.
|
|
30
|
+
reach_commons-0.15.9.dist-info/METADATA,sha256=B-onMQoPO40Lb0YsRYpuyhs46AFHzHk2JA-0CXVN4UM,1860
|
|
31
|
+
reach_commons-0.15.9.dist-info/WHEEL,sha256=FMvqSimYX_P7y0a7UY-_Mc83r5zkBZsCYPm7Lr0Bsq4,88
|
|
32
|
+
reach_commons-0.15.9.dist-info/RECORD,,
|
|
File without changes
|