
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).
This is an asynchronous job scheduler with crontab syntax.
Here is a basic example:
# Should run as-is
import asyncio
from typing import Any
from datetime import datetime
from timewheel import TimeWheel
from timewheel.schedule import Schedule
async def my_job():
print("hello from job!")
await asyncio.sleep(3)
async def my_another_job(some_value: Any):
print(f"Hey! This is my some_value {some_value}")
await asyncio.sleep(1)
def my_special_job():
print("Doing the special job!!")
async def main():
timewheel = TimeWheel(schedules=[
# Runs every 29 minutes using America/Sao_Paulo
# as base
Schedule(name="my-schedule",
expression="*/29 * * * *",
timezone="America/Sao_Paulo",
job=my_job),
# Runs every 5th, 10th and 20th minute on wednesday
# using America/Los_Angeles tz as base
Schedule(name="another-schedule",
expression="5,10,20 * * * 2",
timezone="America/Los_Angeles",
job=my_another_job),
# Runs the special-job every minute except on 2021-12-31
Schedule(name="special-job",
expression="* * * * *",
timezone="America/Sao_Paulo",
excluded_dates=[datetime.strptime('2021-12-31', '%Y-%m-%d')],
job=my_special_job),
# Runs the jobs every minute between monday and friday
# using the range notation
Schedule(name='another-job',
expression='* * * * 0-4',
timezone='America/Sao_Paulo',
job=my_special_job)
])
await timewheel.run()
asyncio.get_event_loop().run_until_complete(main())
The timezone information is based on IANA.
FAQs
Async crontab like scheduler
We found that timewheel-scheduler 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.