You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The `cron.enabled` configuration option needs to be set to true in [Server Configuration](https://docs.strapi.io/developer-docs/latest/setup-deployment-guides/configurations/required/server.html#server-configuration) for the plugin to work.
125
125
126
+
### Multi-instance / clustered deployments
127
+
128
+
When Strapi runs on multiple containers or nodes (for example ECS, Kubernetes, or other redundant services), the same scheduled action may be executed more than once.
129
+
This behavior is discussed in [issue #194](https://github.com/pluginpal/strapi-plugin-publisher/issues/194).
130
+
131
+
Common workarounds reported in that issue include:
132
+
133
+
- use `beforePublish` and `beforeUnpublish` to allow only one instance to execute the action
134
+
- use a shared lock such as Redis
135
+
- use database row locking on the `actions` table
136
+
137
+
Since `strapi-plugin-publisher@2.0.4`, returning `false` from `beforePublish` and `beforeUnpublish` cleanly aborts the action without throwing an error. This makes it possible to implement your own coordination logic in multi-instance deployments.
strapi.log.info(`Skipping unpublish for ${uid}:${entity.documentId} on this instance.`);
160
+
returnfalse;
161
+
}
162
+
163
+
returntrue;
164
+
},
165
+
},
166
+
},
167
+
},
168
+
});
169
+
```
170
+
171
+
For example, some teams use an environment variable to let only one instance proceed, while others use Redis locking or transactional row locking (`FOR UPDATE NOWAIT`) on the `actions` table. See [issue #194](https://github.com/pluginpal/strapi-plugin-publisher/issues/194) for additional background and implementation details.
172
+
126
173
## Usage
127
174
128
175
Once the plugin has been installed, configured and enabled a `Publisher` section will be added to the `informations` section of the edit view for all content types (single + collection) that have `draftAndPublish` enabled. The `Publisher` section will provide the ability to schedule publishing and unpublishing of the content type. The content type publication status is checked every minute.
0 commit comments