Revert "mirrorcheck: Don't use bulk_create on sqlite3"
This reverts commit 3c4ceb16
. We don't need this anymore as bulk_create
gets automatic batching now on sqlite3 so it is safe to use.
Signed-off-by: Dan McGee <dan@archlinux.org>
This commit is contained in:
parent
71259ab4c2
commit
3e0209f5e8
@ -31,7 +31,6 @@
|
||||
from django.db import transaction
|
||||
from django.utils.timezone import now
|
||||
|
||||
from main.utils import database_vendor
|
||||
from mirrors.models import MirrorUrl, MirrorLog
|
||||
|
||||
logging.basicConfig(
|
||||
@ -208,11 +207,7 @@ def run(self):
|
||||
logger.debug("joining on all threads")
|
||||
self.tasks.join()
|
||||
logger.debug("processing %d log entries", len(self.logs))
|
||||
if database_vendor(MirrorLog, mode='write') == 'sqlite':
|
||||
for log in self.logs:
|
||||
log.save(force_insert=True)
|
||||
else:
|
||||
MirrorLog.objects.bulk_create(self.logs)
|
||||
MirrorLog.objects.bulk_create(self.logs)
|
||||
logger.debug("log entries saved")
|
||||
|
||||
# vim: set ts=4 sw=4 et:
|
||||
|
Loading…
Reference in New Issue
Block a user