Skip to content

Commit

Permalink
get summary without feature flag
Browse files Browse the repository at this point in the history
  • Loading branch information
frimpongopoku committed Nov 9, 2023
1 parent dbbdf96 commit 7d407c1
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/task_queue/database_tasks/media_library_cleanup.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@
)
from api.store.media_library import MediaLibraryStore as media_store
from api.utils.constants import MEDIA_LIBRARY_CLEANUP_TEMPLATE
from database.models import FeatureFlag
from database.models import Community, FeatureFlag
from task_queue.models import Task


REMOVE_DUPLICATE_IMAGE_FLAG_KEY = "remove-duplicate-images-feature-flag"


def remove_duplicate_images(task):
def remove_duplicate_images(task=None):
"""
This checks all media on the platform and removes all duplicates.
Its based on the "Remove Duplicate Images" feature flag. For communities that are subscribed
Expand All @@ -33,9 +33,13 @@ def remove_duplicate_images(task):
print("Generating hashes")
result = media_store.generate_hashes(None, None, None)

communities = flag.enabled_communities()
if flag:
communities = flag.enabled_communities()
else:
communities = Community.objects.all()
# task = Task.objects.filter(name="Media Library Cleanup Routine").first()
ids = [c.id for c in communities]
print("Here are the ids", ids)
clean_and_notify(ids,None,task.creator, do_updates)

return "success"
Expand Down

0 comments on commit 7d407c1

Please sign in to comment.