Skip to content

Commit a4dcb7d

Browse files
Merge pull request #773 from adobe-apiplatform/feature/signals
Set start signals on GET batches and all POST batches
2 parents 4668c57 + a5a3c74 commit a4dcb7d

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
'ldap3',
5353
'PyYAML',
5454
'six',
55-
'umapi-client==2.18',
55+
'umapi-client==2.19',
5656
'click',
5757
'click-default-group',
5858
'configparser==3.7.4',

user_sync/connector/connector_umapi.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,7 @@ def iter_users(self, in_group=None):
132132
page_size = 0
133133
page_number = 0
134134
try:
135+
self.connection.start_sync()
135136
u_query = umapi_client.UsersQuery(self.connection, in_group=in_group)
136137
for i, u in enumerate(u_query):
137138
total_count, page_count, page_size, page_number = u_query.stats()
@@ -142,6 +143,8 @@ def iter_users(self, in_group=None):
142143

143144
if (i + 1) % page_size == 0:
144145
self.logger.progress(len(users), total_count)
146+
if page_number == page_count-2:
147+
self.connection.end_sync()
145148
self.logger.progress(total_count, total_count)
146149

147150
except umapi_client.UnavailableError as e:

user_sync/engine/umapi.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -538,10 +538,10 @@ def execute_commands(self, command_list, connector):
538538

539539
total_users = len(command_list)
540540

541-
# split off the last command if we have more than 10, so we can send the signals
541+
# split off the last command if we have more than 10, so we can send an end signal
542+
connector.start_sync()
542543
if len(command_list) > 10:
543544
command_list, last_command = command_list[0:-1], command_list[-1]
544-
connector.start_sync()
545545
else:
546546
last_command = None
547547

0 commit comments

Comments
 (0)