reach_commons 0.17.5__py3-none-any.whl → 0.17.6__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/redis_manager.py
CHANGED
|
@@ -70,3 +70,13 @@ class RedisManager:
|
|
|
70
70
|
- bool: True if the key was set successfully, False otherwise (especially when nx=True and key already exists).
|
|
71
71
|
"""
|
|
72
72
|
return self.redis_connection.set(name=name, value=value, nx=nx, ex=ex)
|
|
73
|
+
|
|
74
|
+
def add_if_absent(self, key, value, expire_seconds=300):
|
|
75
|
+
"""
|
|
76
|
+
Insert the key only if it does not exist.
|
|
77
|
+
Returns True if the key was inserted, False otherwise.
|
|
78
|
+
"""
|
|
79
|
+
result = self.redis_connection.set(
|
|
80
|
+
name=key, value=value, ex=expire_seconds, nx=True
|
|
81
|
+
)
|
|
82
|
+
return result is True
|
|
@@ -23,10 +23,10 @@ reach_commons/reach_aws/kms.py,sha256=HDJ3lnKm6Jah2asizUDtQErlVSjrcV9lOfBPHzUVgu
|
|
|
23
23
|
reach_commons/reach_aws/s3.py,sha256=2MLlDNFx0SROJBpE_KjJefyrB7lMqTlrYuRhSZx4iKs,3945
|
|
24
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=59zlSR-xjCWeJgKDLh8d_G3XoTbrDdAaQ_EIYR4aGpI,2955
|
|
27
27
|
reach_commons/sms_smart_encoding.py,sha256=92y0RmZ0l4ONHpC9qeO5KfViSNq64yE2rc7lhNDSZqE,1241
|
|
28
28
|
reach_commons/utils.py,sha256=dMgKIGqTgoSItuBI8oz81gKtW3qi21Jkljv9leS_V88,8475
|
|
29
29
|
reach_commons/validations.py,sha256=jc78boM62S9Z0Ip_nV1z7I983gGpW2Y7vOCQtmia8OU,964
|
|
30
|
-
reach_commons-0.17.
|
|
31
|
-
reach_commons-0.17.
|
|
32
|
-
reach_commons-0.17.
|
|
30
|
+
reach_commons-0.17.6.dist-info/METADATA,sha256=OFvesYbvPUDMzslPLSdDUVxjIgZdzDL2Zedmi3Zm_s4,1860
|
|
31
|
+
reach_commons-0.17.6.dist-info/WHEEL,sha256=FMvqSimYX_P7y0a7UY-_Mc83r5zkBZsCYPm7Lr0Bsq4,88
|
|
32
|
+
reach_commons-0.17.6.dist-info/RECORD,,
|
|
File without changes
|