AOSSIE-Org / AOSSIE-Org/PictoPy

BUG: Expensive and repeated Metadata Parsing is bad practice

Offen
#1,108 2 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
Python
Sterne
283
Forks
679
Ø Merge
7 T. 2 Std.
Gemergte PRs (30 T.)
3

Beschreibung

### Is there an existing issue for this?

- [x] I have searched the existing issues

### What happened?

**Where** : `backend/app/database/images.py`

**What happened ?** : from `app.utils.images` import` image_util_parse_metadata` is called inside the for loop within `db_get_all_images.`

**What should be** : Move from `app.utils.images` import `image_util_parse_metadata `to the top of the file (global scope).

**Why?**: Importing a module inside a tight loop executing thousands of times adds unnecessary overhead (though Python caches it, it's bad practice).

### Record

- [x] I agree to follow this project's Code of Conduct

Beitragsleitfaden

Beitragsleitfaden öffnen

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.