Skip to content
This repository was archived by the owner on Oct 30, 2018. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions syncano_cli/parse_to_syncano/migrations/relation.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# -*- coding: utf-8 -*-
# a relation helper
import time

from syncano.models import Object
from syncano_cli.logger import get_logger
from syncano_cli.parse_to_syncano.config import PARSE_PAGINATION_LIMIT
Expand Down Expand Up @@ -90,6 +92,7 @@ def _update_syncano_object(self, field_name, target_name, objects_results, synca
"instance_name": instance.name
}
)
time.sleep(1) # avoid throttling;


class RelationProcessor(object):
Expand Down
5 changes: 4 additions & 1 deletion syncano_cli/parse_to_syncano/migrations/transfer.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ def transfer_classes(self, instance):
class_to_process.syncano_name, instance.name)
)
LOG.warning(e)
time.sleep(1) # avoid throttling;

self.set_relations(relations)

Expand Down Expand Up @@ -97,6 +98,8 @@ def transfer_objects(self, instance):
objects_to_add.append(batched_syncano_object)
parse_ids.append(data_object['objectId'])

time.sleep(1) # avoid throttling;

# if objects to add is less than < 10 elements
if objects_to_add:
self._add_last_objects(s_class, objects_to_add, parse_ids, class_to_process, processed)
Expand All @@ -108,7 +111,7 @@ def transfer_files(self):
id=self.data.reference_map[parse_class_name][parse_id],
files=files
)
time.sleep(4) # avoid throttling;
time.sleep(1) # avoid throttling;

def get_class(self, instance, class_name):
s_class = self.syncano_classes.get(class_name)
Expand Down