We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2991a1c commit 8658009Copy full SHA for 8658009
src/content/docs/durable-objects/api/alarms.mdx
@@ -106,6 +106,18 @@ export class AlarmExample extends DurableObject {
106
}
107
```
108
109
+The following example shows how the `alarmInfo` property can be leveraged to identify if the alarm event has been attempted before.
110
+
111
+```js
112
+class MyDurableObject extends DurableObject {
113
+ async alarm(alarmInfo) {
114
+ if (alarmInfo?.retryCount != 0) {
115
+ console.log("This alarm event has been attempted ${alarmInfo?.retryCount} times before.");
116
+ }
117
118
+}
119
+```
120
121
## Related resources
122
123
- Understand how to [use the Alarms API](/durable-objects/examples/alarms-api/) in an end-to-end example.
0 commit comments