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
This code causes resource leak and don't close the TLS socket
constapn=require('../');leti=0;constpushToken=''functionsend(provider,token){constnote=newapn.Notification();note.alert=`Hey hello, I just sent my first Push Notification`;// The topic is usually the bundle identifier of your application.note.topic='<my-topic>';console.log(`Sending: ${note.compile()} to`);returnprovider.send(note,[token]).then(result=>{console.log('sent:',result.sent.length);console.log('failed:',result.failed.length);console.log(result.failed);});}asyncfunctionrun(){constusers=[{name: 'Wendy',devices: [pushToken]},];constservice=newapn.Provider({// ...});Promise.all(users.map(user=>{try{returnsend(service,pushToken);}finally{returnservice.shutdown();}}),).finally(()=>{printActiveHandles();if(i++<10){run();}else{setInterval(()=>{printActiveHandles()},1000)}});}functionprintActiveHandles(){constdata=process._getActiveHandles();constformatted=data.map(item=>item.constructor.name);console.log(`Got ${formatted.length} active handles`,formatted);}run();
❌ Please edit your post and use the provided template when creating a new issue. This helps everyone to understand your post better and asks for essential information to quicker review the issue.
This code causes resource leak and don't close the TLS socket
this will log in the end:
The text was updated successfully, but these errors were encountered: