Background sync: don't try to process infinitely
This commit is contained in:
parent
5a11cd70d1
commit
9901935b83
1 changed files with 12 additions and 4 deletions
|
@ -1345,10 +1345,17 @@ class LibrarySync(Thread):
|
||||||
# processing the item. Do it later
|
# processing the item. Do it later
|
||||||
continue
|
continue
|
||||||
if item['state'] == 9:
|
if item['state'] == 9:
|
||||||
if self.process_deleteditems(item) is True:
|
successful = self.process_deleteditems(item)
|
||||||
deleteListe.append(i)
|
|
||||||
else:
|
else:
|
||||||
if self.process_newitems(item) is True:
|
successful = self.process_newitems(item)
|
||||||
|
if successful is True:
|
||||||
|
deleteListe.append(i)
|
||||||
|
else:
|
||||||
|
# Safety net if we can't process an item
|
||||||
|
item['attempt'] += 1
|
||||||
|
if item['attempt'] > 3:
|
||||||
|
self.logMsg('Repeatetly could not process item %s, abort'
|
||||||
|
% item, -1)
|
||||||
deleteListe.append(i)
|
deleteListe.append(i)
|
||||||
|
|
||||||
# Get rid of the items we just processed
|
# Get rid of the items we just processed
|
||||||
|
@ -1434,7 +1441,8 @@ class LibrarySync(Thread):
|
||||||
'state': state,
|
'state': state,
|
||||||
'type': typus,
|
'type': typus,
|
||||||
'ratingKey': itemId,
|
'ratingKey': itemId,
|
||||||
'timestamp': utils.getUnixTimestamp()
|
'timestamp': utils.getUnixTimestamp(),
|
||||||
|
'attempt': 0
|
||||||
})
|
})
|
||||||
|
|
||||||
def process_playing(self, data):
|
def process_playing(self, data):
|
||||||
|
|
Loading…
Reference in a new issue