@@ -117,15 +117,23 @@ def board(
117117 # wrap fs in cache ----
118118
119119 if cache is DEFAULT :
120- cache_dir = get_cache_dir ()
120+ base_cache_dir = get_cache_dir ()
121121
122122 # manually create a subdirectory for rsc server
123123 if protocol == "rsc" :
124+ # ensures each server_url is its own cache directory
124125 hash_prefix = storage_options ["server_url" ]
126+ board_cache = prefix_cache (fs , hash_prefix )
127+ cache_dir = os .path .join (base_cache_dir , board_cache )
128+
125129 fs = PinsRscCache (
126130 cache_storage = cache_dir , fs = fs , hash_prefix = hash_prefix , same_names = True
127131 )
128132 else :
133+ # ensures each subdir path is its own cache directory
134+ board_cache = prefix_cache (fs , path )
135+ cache_dir = os .path .join (base_cache_dir , board_cache )
136+
129137 fs = PinsCache (
130138 cache_storage = cache_dir , fs = fs , hash_prefix = path , same_names = True
131139 )
@@ -138,10 +146,10 @@ def board(
138146
139147 pickle_kwargs = {"allow_pickle_read" : allow_pickle_read }
140148 # TODO: should use a registry or something
141- if protocol == "rsc" and board_factory is None :
142- board = BoardRsConnect (path , fs , versioned , ** pickle_kwargs )
143- elif board_factory is not None :
149+ if board_factory is not None :
144150 board = board_factory (path , fs , versioned , ** pickle_kwargs )
151+ elif protocol == "rsc" :
152+ board = BoardRsConnect (path , fs , versioned , ** pickle_kwargs )
145153 else :
146154 board = BaseBoard (path , fs , versioned , ** pickle_kwargs )
147155 return board
0 commit comments