@@ -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
208208maintains 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
252252config 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
257257config.runInterval = 5 * 60 * 1000; // 5 minutes
258258` ` `
@@ -262,7 +262,7 @@ config.runInterval = 5 * 60 * 1000; // 5 minutes
262262To 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
267267const eventConfig = config.getEventConfig("HealthCheck", "DB");
268268eventConfig.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
295295const isPeriodicEvent = true;
@@ -311,10 +311,10 @@ For greater flexibility, the decision to block an event can be determined based
311311The 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
316316config.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
327327that 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
332332config.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
0 commit comments