Skip to content

Commit 4f2e705

Browse files
committed
wip
1 parent b5ea799 commit 4f2e705

File tree

2 files changed

+17
-17
lines changed

2 files changed

+17
-17
lines changed

docs/configure-event/index.md

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ they should be processed.
6868
## Parameters
6969

7070
| Property | Description | Default Value |
71-
|-------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------|
71+
| ----------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------- |
7272
| impl | Path of the implementation class associated with the event. | - |
7373
| type | Specifies the type of the event. | - |
7474
| subType | Specifies the subtype of the event, further categorizing the event type. | - |
@@ -122,7 +122,7 @@ instance is overloaded.
122122
## Parameters
123123
124124
| Property | Description | Default Value |
125-
|-------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------|
125+
| ----------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------- |
126126
| impl | Path of the implementation class associated with the event. | - |
127127
| type | Specifies the type of the periodic event. | - |
128128
| subType | Specifies the subtype of the periodic event, further categorizing the event type. | - |
@@ -208,7 +208,7 @@ or months. Please note that the minimum interval allowed between two executions
208208
maintains stability and avoids overloading.
209209

210210
| Cron Expression | Description |
211-
|---------------------|---------------------------------------------------------------------------|
211+
| ------------------- | ------------------------------------------------------------------------- |
212212
| `0 * * * *` | Runs at the start of every hour. |
213213
| `* * * * *` | Runs every minute. |
214214
| `0 0 * * *` | Runs at midnight every day. |
@@ -252,7 +252,7 @@ The initialization configuration can be changed by setting the value of the corr
252252
config class instance. Here is an example:
253253

254254
```js
255-
const {config} = require("@cap-js-community/event-queue");
255+
const { config } = require("@cap-js-community/event-queue");
256256
257257
config.runInterval = 5 * 60 * 1000; // 5 minutes
258258
```
@@ -262,7 +262,7 @@ config.runInterval = 5 * 60 * 1000; // 5 minutes
262262
To change the configuration of a specific event, you can refer to the example below:
263263

264264
```js
265-
const {config} = require("@cap-js-community/event-queue");
265+
const { config } = require("@cap-js-community/event-queue");
266266
267267
const eventConfig = config.getEventConfig("HealthCheck", "DB");
268268
eventConfig.load = 5;
@@ -289,7 +289,7 @@ accomplished.
289289
## Blocking/Unblocking based on configuration
290290

291291
```js
292-
const {config} = require("@cap-js-community/event-queue");
292+
const { config } = require("@cap-js-community/event-queue");
293293
294294
// Block type: HealthCheck and subType: DB for tenant 123
295295
const isPeriodicEvent = true;
@@ -311,10 +311,10 @@ For greater flexibility, the decision to block an event can be determined based
311311
The example below shows how to register the callback.
312312

313313
```js
314-
const {config} = require("@cap-js-community/event-queue");
314+
const { config } = require("@cap-js-community/event-queue");
315315
316316
config.isEventBlockedCb = async (type, subType, isPeriodicEvent, tenant) => {
317-
// Perform custom check and return true or false
317+
// Perform custom check and return true or false
318318
};
319319
```
320320

@@ -327,15 +327,15 @@ To react to unsubscribe events across all application instances, the event-queue
327327
that are triggered when a tenant is unsubscribed. Follow the code example below:
328328

329329
```javascript
330-
const {config} = require("@cap-js-community/event-queue");
330+
const { config } = require("@cap-js-community/event-queue");
331331
332332
config.attachUnsubscribeHandler(async (tenantId) => {
333-
try {
334-
cds.log("server").info("received unsubscribe event via event-queue", {tenantId});
335-
await cds.db.disconnect(tenantId);
336-
} catch (err) {
337-
logger.error("disconnect db failed!", {tenantId}, err);
338-
}
333+
try {
334+
cds.log("server").info("received unsubscribe event via event-queue", { tenantId });
335+
await cds.db.disconnect(tenantId);
336+
} catch (err) {
337+
logger.error("disconnect db failed!", { tenantId }, err);
338+
}
339339
});
340340
```
341341

docs/setup/index.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,10 @@ such as the configuration file path, event processing behavior, load balancing,
6464
The table includes the parameter name, a description of its purpose, and the default value if not specified.
6565

6666
| Name | Description | Default | Can be changed at runtime |
67-
|:-------------------------------------|:-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|:---------------| :------------------------ |
67+
| :----------------------------------- | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :------------- | :------------------------ |
6868
| configFilePath | Path to the configuration file. | null | no |
6969
| events | Options to allow events in the configuration. E.g. via cds-env. | {} | no |
70-
| periodicEvents | Options to allow periodicEvents in the configuration. E.g. via cds-env | {} | no |
70+
| periodicEvents | Options to allow periodicEvents in the configuration. E.g. via cds-env | {} | no |
7171
| registerAsEventProcessor | Whether or not to register as an event processor. If false, the app can publish events but doesn't process events. | true | no |
7272
| processEventsAfterPublish | Whether or not to process events immediately after publish. Events are distributed via Redis to all available app instances. | true | no |
7373
| isEventQueueActive | Determines if the event queue is active. This property controls whether events are automatically processed. It can be modified in real-time to temporarily disable periodic runs. | true | yes |

0 commit comments

Comments
 (0)