Skip to content

Commit a0f7016

Browse files
authored
rpc : fix cache directory initialization (#13188)
Signed-off-by: xiaofei <[email protected]>
1 parent 19e899c commit a0f7016

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

examples/rpc/rpc-server.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -304,8 +304,9 @@ int main(int argc, char * argv[]) {
304304
get_backend_memory(&free_mem, &total_mem);
305305
}
306306
const char * cache_dir = nullptr;
307-
std::string cache_dir_str = fs_get_cache_directory() + "rpc/";
307+
std::string cache_dir_str;
308308
if (params.use_cache) {
309+
cache_dir_str = fs_get_cache_directory() + "rpc/";
309310
if (!fs_create_directory_with_parents(cache_dir_str)) {
310311
fprintf(stderr, "Failed to create cache directory: %s\n", cache_dir_str.c_str());
311312
return 1;

0 commit comments

Comments
 (0)