Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improved async/threading attachment support #1086

Merged
merged 3 commits into from
Mar 29, 2024
Merged

Conversation

caronc
Copy link
Owner

@caronc caronc commented Mar 25, 2024

Description:

Related issue (if applicable): BirdNET-Pi/1171

Issue was detected in another system. Situation is a racing condition where multiple services want to share the same retrieved attachment. The problem is the asynchronous process starts all fetching at the same time. The ideal approach is to fetch the image once, and the remaining services share from the single fetch.

This PR Resolves this issue.

Checklist

  • The code change is tested and works locally.
  • There is no commented out code in this PR.
  • No lint errors (use flake8)
  • 100% test coverage

Testing

Anyone can help test this source code as follows:

# Create a virtual environment to work in as follows:
python3 -m venv apprise

# Change into our new directory
cd apprise

# Activate our virtual environment
source bin/activate

# Install the branch
pip install git+https://github.com/caronc/apprise.git@/improved-attachment-support

# Test out the changes by just sending a web based attachment to 2 or more endpoints:
apprise -t "Test Title" -b "Test Message" \
  discord://credentials \
  pover://credentials \
 --attach=http://website/remote/image.jpg
  

@codecov-commenter
Copy link

codecov-commenter commented Mar 25, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 99.28%. Comparing base (195d0ef) to head (e9f6ad3).

❗ Current head e9f6ad3 differs from pull request most recent head f14e764. Consider uploading reports for the commit f14e764 to get more accurate results

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1086   +/-   ##
=======================================
  Coverage   99.28%   99.28%           
=======================================
  Files         137      137           
  Lines       17874    17885   +11     
  Branches     3649     3652    +3     
=======================================
+ Hits        17746    17757   +11     
  Misses        119      119           
  Partials        9        9           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@caronc caronc merged commit 8180470 into master Mar 29, 2024
12 checks passed
@caronc caronc deleted the improved-attachment-support branch March 30, 2024 01:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants