
Research
/Security News
Critical Vulnerability in NestJS Devtools: Localhost RCE via Sandbox Escape
A flawed sandbox in @nestjs/devtools-integration lets attackers run code on your machine via CSRF, leading to full Remote Code Execution (RCE).
Retry decorator for both synchronous and asynchronous functions.
pip install the-retry
Arguments:
expected_exception
:
exception or tuple of exceptions (default BaseException).Keyword arguments:
attempts
:
how much times the function will be retried, value -1 is infinite (default 2).backoff
:
time interval between the attemps
(default 0).exponential_backoff
:
current_backoff = backoff * 2 ** retries
(default False).ignore_exceptions
:
only log error but not raise exception if attempts
exceeds (default False).jitter
:
maximum value of deviation from the current_backoff
(default 0).maximum_backoff
:
current_backoff = min(current_backoff, maximum_backoff)
(default 0).on_exception
:
function that called or await on error occurs (default None).
Be aware if a decorating function is synchronous on_exception
function must be
synchronous too and accordingly for asynchronous function on_exception
must be
asynchronous.from the_retry import retry
@retry()
def some_function():
print("some function")
from the_retry import retry
def side_effect():
print("side effect")
@retry(expected_exception=ValueError, on_exception=side_effect)
def some_function():
print("some function")
from the_retry import retry
async def async_side_effect():
print("async side effect")
@retry(
expected_exception=(ValueError, AttributeError)
attempts=10,
backoff=1,
exponential_backoff=True,
jitter=1,
maximum_backoff=60,
on_exception=async_side_effect,
)
async def async_some_function():
print("some function")
FAQs
Retry decorator for both synchronous and asynchronous functions.
We found that the-retry demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
/Security News
A flawed sandbox in @nestjs/devtools-integration lets attackers run code on your machine via CSRF, leading to full Remote Code Execution (RCE).
Product
Customize license detection with Socket’s new license overlays: gain control, reduce noise, and handle edge cases with precision.
Product
Socket now supports Rust and Cargo, offering package search for all users and experimental SBOM generation for enterprise projects.