fix: sanitizy replayq dir filepath

Colons (`:`) are not allowed in Windows.
This commit is contained in:
Thales Macedo Garitezi 2023-01-12 14:04:13 -03:00
parent 4c04a01370
commit 477c55d8ef
1 changed files with 5 additions and 1 deletions

View File

@ -1021,9 +1021,13 @@ queue_count(Q) ->
replayq:count(Q).
disk_queue_dir(Id, Index) ->
QDir = binary_to_list(Id) ++ ":" ++ integer_to_list(Index),
QDir0 = binary_to_list(Id) ++ "_" ++ integer_to_list(Index),
QDir = sanitizy_file_path(QDir0),
filename:join([emqx:data_dir(), "resource_worker", node(), QDir]).
sanitizy_file_path(Filepath) ->
iolist_to_binary(string:replace(Filepath, ":", "_", all)).
clear_disk_queue_dir(Id, Index) ->
ReplayQDir = disk_queue_dir(Id, Index),
case file:del_dir_r(ReplayQDir) of