fix: sanitizy replayq dir filepath
Colons (`:`) are not allowed in Windows.
This commit is contained in:
parent
4c04a01370
commit
477c55d8ef
|
@ -1021,9 +1021,13 @@ queue_count(Q) ->
|
||||||
replayq:count(Q).
|
replayq:count(Q).
|
||||||
|
|
||||||
disk_queue_dir(Id, Index) ->
|
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]).
|
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) ->
|
clear_disk_queue_dir(Id, Index) ->
|
||||||
ReplayQDir = disk_queue_dir(Id, Index),
|
ReplayQDir = disk_queue_dir(Id, Index),
|
||||||
case file:del_dir_r(ReplayQDir) of
|
case file:del_dir_r(ReplayQDir) of
|
||||||
|
|
Loading…
Reference in New Issue