mirror of
https://github.com/alexgo-io/stacks-puppet-node.git
synced 2026-04-23 19:31:00 +08:00
use all drivers, but prioritize local ones
This commit is contained in:
@@ -867,7 +867,7 @@ def get_mutable(data_id, device_ids, raw=False, blockchain_id=None, data_pubkey=
|
||||
|
||||
# optimization: try local drivers before non-local drivers
|
||||
storage_drivers = prioritize_read_drivers(config_path, storage_drivers)
|
||||
|
||||
|
||||
# which storage drivers and/or URLs will we use?
|
||||
for driver in storage_drivers:
|
||||
for fq_data_id in fq_data_ids:
|
||||
@@ -947,7 +947,7 @@ def get_mutable(data_id, device_ids, raw=False, blockchain_id=None, data_pubkey=
|
||||
if stale:
|
||||
res['stale'] = stale
|
||||
res['error'] = 'Failed to fetch mutable data for {} due to version mismatch.'
|
||||
log.error("Failed to fetch mutable data for {} due to version mismatch.")
|
||||
log.error("Failed to fetch mutable data for {} due to version mismatch.".format(data_id))
|
||||
|
||||
return res
|
||||
|
||||
@@ -4311,8 +4311,8 @@ def prioritize_read_drivers(config_path, drivers):
|
||||
local_read_drivers = get_read_local_storage_drivers(config_path, drivers)
|
||||
first_drivers = []
|
||||
last_drivers = []
|
||||
for drvr in local_read_drivers:
|
||||
if drvr in drivers:
|
||||
for drvr in drivers:
|
||||
if drvr in local_read_drivers:
|
||||
first_drivers.append(drvr)
|
||||
else:
|
||||
last_drivers.append(drvr)
|
||||
|
||||
Reference in New Issue
Block a user