File tree Expand file tree Collapse file tree 1 file changed +11
-11
lines changed Expand file tree Collapse file tree 1 file changed +11
-11
lines changed Original file line number Diff line number Diff line change @@ -107,18 +107,18 @@ async function cachePurgeTag(batch: MessageBatch, env: Env) {
107
107
// sendBatch only allows for a maximum of 100 messages.
108
108
const promises : ReturnType < typeof env . DB . batch > [ ] = [ ] ;
109
109
for ( const urlChunk of chunks ( results , 100 ) ) {
110
+ const batch = urlChunk . map <
111
+ MessageSendRequest < z . infer < typeof PurgeUrlSchema > >
112
+ > ( ( data ) => ( {
113
+ body : {
114
+ url : data . value ,
115
+ zone : data . zone ,
116
+ } ,
117
+ contentType : "json" ,
118
+ } ) ) ;
119
+ console . debug ( "[Cache Purge Tag] Send Batch" , batch ) ;
110
120
promises . push (
111
- env . CACHE_PURGE_URL . sendBatch (
112
- urlChunk . map < MessageSendRequest < z . infer < typeof PurgeUrlSchema > > > (
113
- ( data ) => ( {
114
- body : {
115
- url : data . value ,
116
- zone : data . zone ,
117
- } ,
118
- contentType : "json" ,
119
- } ) ,
120
- ) ,
121
- ) . then ( ( ) => {
121
+ env . CACHE_PURGE_URL . sendBatch ( batch ) . then ( ( ) => {
122
122
const ids = urlChunk . map < string > ( ( { id } ) => id ) ;
123
123
return env . DB . batch ( [
124
124
env . DB . prepare (
You can’t perform that action at this time.
0 commit comments