reown-com / a2

An Asynchronous Apple Push Notification (apns2) Client for Rust
MIT License
150 stars 52 forks source link

Fix the error of duplicate signing within multiple threads #85

Open henry42 opened 5 months ago

henry42 commented 5 months ago

Description

If you use the signer or client in multiple threads, updates to the signature may not be locked and generated too frequently, which can result in Apple rejecting it with '429 The provider token is being updated too frequently.' This pull request fixes the issue, albeit in an ugly but effective way.

How Has This Been Tested?

There is a test function named test_signature_caching_in_multithreads.

Due Dilligence