Fix rare sync crash when queue was full

This commit is contained in:
croneter 2020-03-21 14:22:43 +01:00
parent b40b03efc5
commit db48ffb419

View file

@ -1,7 +1,7 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
from __future__ import absolute_import, division, unicode_literals from __future__ import absolute_import, division, unicode_literals
from logging import getLogger from logging import getLogger
from Queue import Empty from Queue import Full
from . import common, sections from . import common, sections
from ..plex_db import PlexDB from ..plex_db import PlexDB
@ -9,7 +9,7 @@ from .. import backgroundthread
LOG = getLogger('PLEX.sync.fill_metadata_queue') LOG = getLogger('PLEX.sync.fill_metadata_queue')
QUEUE_TIMEOUT = 10 # seconds QUEUE_TIMEOUT = 60 # seconds
class FillMetadataQueue(common.LibrarySyncMixin, class FillMetadataQueue(common.LibrarySyncMixin,
@ -49,7 +49,7 @@ class FillMetadataQueue(common.LibrarySyncMixin,
try: try:
self.get_metadata_queue.put((count, plex_id, section), self.get_metadata_queue.put((count, plex_id, section),
timeout=QUEUE_TIMEOUT) timeout=QUEUE_TIMEOUT)
except Empty: except Full:
LOG.error('Putting %s in get_metadata_queue timed out - ' LOG.error('Putting %s in get_metadata_queue timed out - '
'aborting sync now', plex_id) 'aborting sync now', plex_id)
section.sync_successful = False section.sync_successful = False