File tree Expand file tree Collapse file tree 3 files changed +8
-14
lines changed
Expand file tree Collapse file tree 3 files changed +8
-14
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ " @pluginpal/webtools-core " : patch
3+ ---
4+
5+ Prevent deadlocks from happening by using the native deleteMany service
Original file line number Diff line number Diff line change @@ -79,7 +79,7 @@ const generateUrlAliases = async (parms: GenerateParams) => {
7979 await Promise . all ( types . map ( async ( type ) => {
8080 if ( generationType === 'all' ) {
8181 // Delete all the URL aliases for the given type.
82- await getPluginService ( ' url-alias') . deleteMany ( {
82+ await strapi . entityService . deleteMany ( 'plugin::webtools. url-alias', {
8383 // @ts -ignore
8484 locale : 'all' ,
8585 filters : {
@@ -90,7 +90,7 @@ const generateUrlAliases = async (parms: GenerateParams) => {
9090
9191 if ( generationType === 'only_generated' ) {
9292 // Delete all the auto generated URL aliases of the given type.
93- await getPluginService ( ' url-alias') . deleteMany ( {
93+ await strapi . entityService . deleteMany ( 'plugin::webtools. url-alias', {
9494 // @ts -ignore
9595 locale : 'all' ,
9696 filters : {
Original file line number Diff line number Diff line change 11import { factories } from '@strapi/strapi' ;
2- import { EntityService , Common } from '@strapi/types' ;
32
43/**
54 * URL alias service
65 */
76
87const contentTypeSlug = 'plugin::webtools.url-alias' ;
98
10- export default factories . createCoreService ( contentTypeSlug , ( { strapi } ) => ( {
11- deleteMany : async ( params : EntityService . Params . Pick < Common . UID . ContentType , 'filters' > ) => {
12- const toBeDeletedEntities = await strapi . entityService . findMany ( contentTypeSlug , params ) ;
13-
14- await Promise . all ( toBeDeletedEntities . map ( async ( entity ) => {
15- await strapi . entityService . delete ( contentTypeSlug , entity . id ) ;
16- } ) ) ;
17-
18- return true ;
19- } ,
20- } ) ) ;
9+ export default factories . createCoreService ( contentTypeSlug ) ;
You can’t perform that action at this time.
0 commit comments