惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

The GitHub Blog
The GitHub Blog
L
Lohrmann on Cybersecurity
T
Threatpost
T
Threat Research - Cisco Blogs
C
Cybersecurity and Infrastructure Security Agency CISA
S
Schneier on Security
Engineering at Meta
Engineering at Meta
Scott Helme
Scott Helme
博客园 - 三生石上(FineUI控件)
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
V
Visual Studio Blog
I
Intezer
L
LangChain Blog
Apple Machine Learning Research
Apple Machine Learning Research
S
Securelist
C
Cyber Attacks, Cyber Crime and Cyber Security
B
Blog RSS Feed
M
MIT News - Artificial intelligence
V
Vulnerabilities – Threatpost
T
The Exploit Database - CXSecurity.com
NISL@THU
NISL@THU
Cisco Talos Blog
Cisco Talos Blog
C
CXSECURITY Database RSS Feed - CXSecurity.com
Know Your Adversary
Know Your Adversary
H
Hackread – Cybersecurity News, Data Breaches, AI and More
阮一峰的网络日志
阮一峰的网络日志
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
The Cloudflare Blog
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Vercel News
Vercel News
Stack Overflow Blog
Stack Overflow Blog
The Hacker News
The Hacker News
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
The Register - Security
The Register - Security
Simon Willison's Weblog
Simon Willison's Weblog
Security Latest
Security Latest
C
Cisco Blogs
量子位
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
P
Proofpoint News Feed
Cyberwarzone
Cyberwarzone
Y
Y Combinator Blog
C
CERT Recently Published Vulnerability Notes
T
Tenable Blog
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
AWS News Blog
AWS News Blog
Project Zero
Project Zero
D
Darknet – Hacking Tools, Hacker News & Cyber Security
A
Arctic Wolf
K
Kaspersky official blog

Deno

Deno 2.8 | Deno Claw Patrol: an open-source security firewall for agents | Deno Fresh 2.3: Zero JS by default, View Transitions, and Temporal support | Deno Deno 2.7: Temporal API, Windows ARM, and npm overrides | Deno Build a dinosaur runner game with Deno, pt. 6 | Deno Build a dinosaur runner game with Deno, pt. 5 | Deno Deno Deploy is Generally Available | Deno Introducing Deno Sandbox | Deno Build a dinosaur runner game with Deno, pt. 4 | Deno Build a dinosaur runner game with Deno, pt. 3 | Deno Build a dinosaur runner game with Deno, pt. 2 | Deno React / Next.js Denial-of-Service Vulnerability: Deno Deploy users protected | Deno Deno 2.6: dx is the new npx | Deno Build a dinosaur runner game with Deno, pt. 1 | Deno React Server Functions / Next.js Vulnerability: Deno Deploy users protected | Deno My highlights from the new Deno Deploy | Deno Deno's Other Open Source Projects | Deno How Deno protects against npm exploits | Deno Help Us Raise $200k to Free JavaScript from Oracle | Deno Deno 2.5: Permissions in the config file | Deno Fresh 2.0 Graduates to Beta, Adds Vite Support | Deno Deno 2.4: deno bundle is back | Deno JavaScript™ Trademark Update | Deno What's coming to JavaScript | Deno A brief history of JavaScript | Deno Reports of Deno's Demise Have Been Greatly Exaggerated | Deno An Update on Fresh | Deno How Plaid migrated 100 services to a new database platform 5x faster with Deno | Deno Deno 2.3: Improved deno compile, local npm packages, and more | Deno Add JSR packages with pnpm and Yarn | Deno Zero-config Debugging with Deno and OpenTelemetry | Deno Exploring Art with TypeScript, Jupyter, Polars, and Observable Plot | Deno Deno v Oracle Update 3: Fighting the JavaScript Trademark | Deno Build a custom RAG AI agent in TypeScript and Jupyter | Deno How to get deep traces in your Node.js backend with OTel and Deno | Deno toranoana.deno #20 登録受付中(2025年3月14日) | Deno Node just added TypeScript support. What does that mean for Deno? | Deno The Dino 🦕, the Llama 🦙, and the Whale 🐋 | Deno Publish a lint rule, get a prize | Deno Deno 2.2: OpenTelemetry, Lint Plugins, node:sqlite | Deno If you're not using npm specifiers, you're doing it wrong | Deno How Deno's documentation is evolving | Deno Oracle justified its JavaScript trademark with Node.js—now it wants that ignored | Deno Introducing the JSR open governance board | Deno Intro to Wasm in Deno | Deno Announcing OpenAI on JSR | Deno Deno in 2024 | Deno Goodbye WinterCG, welcome WinterTC | Deno Build a SolidJS app with Deno | Deno Run your Next.js SSR app on Deno Deploy | Deno Solve Advent of Code 2024 with Deno and Win Prizes! | Deno Deno v. Oracle: Canceling the JavaScript Trademark | Deno Deno 2.1: Wasm Imports and other enhancements | Deno Build a Typesafe API with tRPC and Deno | Deno Self-contained Executable Programs with Deno Compile | Deno Build a Database App with Drizzle ORM and Deno | Deno Introducing your new JavaScript package manager: Deno | Deno Announcing Growthbook on JSR | Deno Build an Astro site with Deno | Deno How to convert CommonJS to ESM | Deno Announcing Deno 2 | Deno The Final Touches: What’s New In v2.0.0-rc.10 | Deno Announcing Stable V8 Bindings for Rust | Deno Deno 2.0 Release Candidate | Deno Secure, efficient private npm registries with Cloudsmith and Deno | Deno Painting the Plane as We Fly It: Designing JSR | Deno Introducing Web Cache API support on Deno Deploy | Deno Deno 1.46: The Last 1.x Release | Deno Protect your cloud spend with new Deno Deploy spend limits | Deno What we got wrong about HTTP imports | Deno Benchmarking AWS Lambda Cold Starts Across JavaScript Runtimes | Deno Announcing Supabase on JSR | Deno Deno 1.45: Workspace and Monorepo Support | Deno Introducing KV Backup for Deno Subhosting | Deno A Gentle Intro to TypeScript | Deno Announcing Hono on JSR | Deno How We Made the Deno Language Server Ten Times Faster | Deno How the Guardian uses Deno to audit accessibility and performance across their 2.7 million articles | Deno Introducing More Flexible Domain Association for Deno Subhosting | Deno The stabilization process of the Standard Library has begun | Deno Deno 1.44: Private npm registries, improved Node.js compat, and performance boosts | Deno How we built a secure, performant, multi-tenant cloud platform to run untrusted code | Deno The Deno Standard Library is now available on JSR | Deno How to document your JavaScript package | Deno Your Low Code Solution Needs an Escape Hatch | Deno Deno 1.43: Improved Language Server performance | Deno How Slack used Deno to save months of engineering effort in launching their new platform | Deno JSR Is Not Another Package Manager | Deno Announcing the Hookdeck SDK on JSR | Deno Announcing the Neon Serverless Driver on JSR | Deno An intro to TSConfig for JavaScript Developers | Deno How we built JSR | Deno How Netlify used Deno Subhosting to build a successful edge functions product | Deno Introducing Simpler Project Creation in Deno Deploy | Deno Deno 1.42: Better dependency management with JSR | Deno Introducing deployctl, the command line interface for Deno Deploy | Deno Introducing JSR - the JavaScript Registry | Deno How to add Monaco to a Next.js app and securely run untrusted user code | Deno Survey Results and Roadmap | Deno Deno 1.41: smaller deno compile binaries | Deno
Announcing Deno Cron | Deno
2023-11-29 · via Deno

Building for the web is increasingly complex. Writing modern software includes leveraging cloud infrastructure, dissecting boilerplate code, and managing intricate configurations — when developers only want to focus on writing business logic.

Deno aims to radically simplify web development by removing config and unnecessary boilerplate. We’ve built Deno KV, a serverless database, and Deno Queues, a way to offload tasks or schedule future work, right into the runtime, so adding them to your application only requires a few lines of code.

Today, we’re thrilled to take another step in simplifying web development by introducing Deno Cron, an easy way to create scheduled jobs:

Deno.cron("Sample cron job", "*/10 * * * *", () => {
  console.log("This will run every 10 minutes");
});

In this post, we’ll go over:

  • Using Deno.cron
  • Deno Cron on Deno Deploy
  • How it works on Deno Deploy
  • What’s next?
Learn some tips and tricks about Deno.cron() in the above YouTube video.

Using Deno Cron

Deno.cron() (available behind the --unstable flag as of 1.38), is a function that takes three parameters:

  • name , the name of your scheduled job
  • schedule , which uses the Unix cron format and where the time is in the UTC timezone
  • handler, a function that is executed on the schedule provided

Unlike cron on UNIX/Linux, Deno Cron executions do not overlap. This means that if you schedule something to run every 10 minutes, but the task takes 30 minutes to complete, Deno Cron automatically skips the next scheduled run until the task is complete. Overlapping cron jobs can lead to unintended issues and requires extra tedious logic to avoid, but Deno Cron side steps that completely.

We’re also working to support a JavaScript friendly API for specifying the cron schedule.

Deno Cron on Deno Deploy

On Deno Deploy, our multi-tenant distributed serverless JavaScript platform, Deno.cron() is automatically detected and managed so you don’t need to worry about anything.

You can run cron jobs without a web server or even consistent incoming requests to keep your isolate alive. That’s because whenever your project is deployed, Deno Deploy automatically detects your cron jobs and evaluates them. When its time for your handler to run, Deno Deploy automatically spins up an isolate on-demand to run them.

This code works on Deno Deploy. Check out the playground.

We’ve also added a new Cron tab in the Deno Deploy dashboard, which shows all active cron jobs in your project:

The new Cron tab in your project settings will show your scheduled jobs detected by Deno Deploy.

A new cron tab in your Project that shows your active cron jobs.

Your cron jobs will also appear in your logs.

Your cron jobs will appear in your logs.

To modify or stop an existing cron, change your code and create a new deployment. For example, if you remove a  Deno.cron from your code and deploy it, those jobs will no longer be scheduled to run.

Your Deno Cron handlers can perform all sorts of actions, such as updating state in Deno KV, pinging a website, sending an email, initiating a database backup, calling an API at regular intervals, and more.

How does it work on Deno Deploy?

How exactly does Deno Deploy know there’s a cron in your code, even when there’s no web server handling requests?

When a new production deployment of your project is created, an ephemeral V8 isolate is used to evaluate your project’s top-level scope and to discover any Deno.cron definitions. A global cron scheduler is then updated with your project’s latest cron definitions, which includes updates to your existing crons, new crons, and deleted crons.

The global cron scheduler is a reliable service that’s responsible for scheduling and dispatching cron jobs based on the specified schedule. During dispatch, an on-demand v8 isolate is spun up to execute the job using the same production deployment.

These 24 lines of code creates a cron job to fetch weather data from a public API and adds it to Deno KV every hour. The web server endpoint prints out all of the timestamps and weather data.

Using Deno Cron on Deno Deploy makes it simple to create cron jobs and host them in the cloud without any configuration in a matter of minutes.

Other resources

What’s next?

Building a scalable business requires the ability to schedule jobs reliably and easily. Deno Cron is a simple way to schedule jobs without unnecessary configuration.

With Deno Cron, Deno KV, Deno Queues, npm, and web standards APIs, building and launching a production-ready server on Deno is simpler and more productive. But we are not there yet. We have a few more cloud primitives that we hope to add to the runtime — stay tuned.

Join the discussion on Hacker News.

🚨️ We’re actively seeking feedback for Deno Cron 🚨️

If you’re using it (or plan to use it) in a commercial capacity and want to connect directly to one of our engineers for technical support, please let us know via email or Discord.