
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).
TimerThread is
TimerThread supports to
@task
decorator to define taskDefine your function, now(cost)
as an example:
import time
def now(cost=1):
time.sleep(cost)
print( time.strftime('%Y-%m-%d %H:%M:%S %Z', time.localtime()) )
Create a TimerThread scheduler and start it:
import timerthread
timer = timerthread.Scheduler('recur', 3, now, args=(1,))
timer.start()
Shutdown the scheduler:
timer.cancel()
@task
decoratorUse @task
decorator to define your function, then schedule it and start the scheduler, now(cost)
as an example:
import time
import timerthread
@timerthread.task('recur', 3)
def now(cost=1):
time.sleep(cost)
print( time.strftime('%Y-%m-%d %H:%M:%S %Z', time.localtime()) )
timer = now.sched(cost=1)
timer.start()
When you'd like to cancel the recurring execution, shutdown the scheduler as usual:
timer.cancel()
$ pip install timerthread
Scheduler
class timerthread.Scheduler(trigger, interval, fn, args=(), kwargs={})
trigger
must be 'delay'
or 'recur'
.
stopped
The scheduler is stopped or not, True
(default) or False
.
result
The execution result, {}
as default.
start()
Let scheduler start executing your function as scheduled in the background.
cancel()
Shutdown the scheduler.
task
class timerthread.task(trigger, interval)
trigger
must be 'delay'
or 'recur'
.
Use @task
decorator to define your function, then schedule it and start the scheduler:
@timerthread.task(trigger, interval)
def fn(args, kwargs):
pass
timer = fn.sched(*args, **kwargs)
fn.sched(*args, **kwargs)
returns timerthread.Scheduler
instance.
FAQs
A lightweight task scheduling timer
We found that TimerThread 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.