Skip to content

Commit

Permalink
Fix video ordering (#35)
Browse files Browse the repository at this point in the history
* Remove setting as we are not using pgbouncer

* Attempt fix ordering
  • Loading branch information
aurora-dot authored Jul 20, 2024
1 parent d0e584d commit fb656af
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
4 changes: 0 additions & 4 deletions core/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,9 +202,5 @@
SESSION_COOKIE_SAMESITE = "None"
SESSION_COOKIE_DOMAIN = SITENAME

DISABLE_SERVER_SIDE_CURSORS = (
True # required when using pgbouncer's pool_mode=transaction
)

django_on_heroku.settings(locals())
config = locals()
3 changes: 2 additions & 1 deletion notifier/lib/database_iterator.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ def collect_new_videos():
def _save_data(collected_videos, search_query):
videos = []
LOGGER.info("Collector - %s: Saving data into db...", datetime.now())
for video in collected_videos:
for video in reversed(collected_videos):
channel, _ = models.YouTubeChannel.objects.get_or_create(
channel_link=video["channel"].pop("channel_link"), defaults=video["channel"]
)
Expand All @@ -104,6 +104,7 @@ def _save_data(collected_videos, search_query):
**video["video"],
youtube_query=search_query,
youtube_channel=channel,
created_at=datetime.now(),
)
)

Expand Down

0 comments on commit fb656af

Please sign in to comment.