aboutsummaryrefslogtreecommitdiff
path: root/rp
diff options
context:
space:
mode:
authorRob Austein <sra@hactrn.net>2016-03-01 05:49:43 +0000
committerRob Austein <sra@hactrn.net>2016-03-01 05:49:43 +0000
commit8f3cc172776b3a0e6382caa2b3d44591d341e76b (patch)
tree435edee58fc7eaea5f0e407b22619c28440ad4f2 /rp
parent8ae577caff193627ea5d5433afff7643318c1f58 (diff)
Fix bug introduced while refactoring bulk SQL insertion.
svn path=/branches/tk705/; revision=6306
Diffstat (limited to 'rp')
-rwxr-xr-xrp/rcynic/rcynicng6
1 files changed, 5 insertions, 1 deletions
diff --git a/rp/rcynic/rcynicng b/rp/rcynic/rcynicng
index 78987073..c8add7fe 100755
--- a/rp/rcynic/rcynicng
+++ b/rp/rcynic/rcynicng
@@ -995,9 +995,12 @@ class Fetcher(object):
@tornado.gen.coroutine
def _rrdp_bulk_create(self, new_objs, existing_objs):
from django.db import IntegrityError
+
#logger.debug("Bulk creation of new RPKIObjects")
+
try:
RPKIObject.objects.bulk_create(new_objs)
+
except IntegrityError:
#logger.debug("Some objects already existed, weeding and retrying")
i = 0
@@ -1010,7 +1013,8 @@ class Fetcher(object):
else:
del new_objs[i]
RPKIObject.objects.bulk_create(new_objs)
- del new_objs[:]
+
+ del new_objs[:]
@tornado.gen.coroutine
def _rrdp_fetch(self):