Skip to content
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: 2 additions & 1 deletion server/demo.conf
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,8 @@
# Uncomment line below to turn on the feature to add description field to channelfinder
#recordDesc = True

# The size limit for finding channels (ie the value of the '~size' query parameter)
# The size limit for finding channels and submitting channels
# (ie the value of the '~size' query parameter)
# If not specified then the fallback is the server default
#findSizeLimit = 10000

Expand Down
10 changes: 8 additions & 2 deletions server/recceiver/cfstore.py
Original file line number Diff line number Diff line change
Expand Up @@ -709,14 +709,20 @@ def __updateCF__(
_log.debug("Add new alias: {s}".format(s=channels[-1]))
_log.info("Total channels to update: {nChannels} {iocName}".format(nChannels=len(channels), iocName=iocName))
if len(channels) != 0:
client.set(channels=channels)
cf_set_chunked(client, channels, conf.get("findSizeLimit", 10000))
else:
if old_channels and len(old_channels) != 0:
client.set(channels=channels)
cf_set_chunked(client, channels, conf.get("findSizeLimit", 10000))
if processor.cancelled:
raise defer.CancelledError()


def cf_set_chunked(client, channels, chunk_size=10000):
for i in range(0, len(channels), chunk_size):
chunk = channels[i : i + chunk_size]
client.set(channels=chunk)


def create_properties(owner, iocTime, recceiverid, hostName, iocName, iocIP, iocid):
return [
create_property(owner, "hostName", hostName),
Expand Down
Loading