- Add short delay in file watcher to prevent overlapped read.

This commit is contained in:
Tanasart 2024-06-03 10:48:18 +07:00
parent 05eb31ad8e
commit ddddb5d18d
6 changed files with 31 additions and 19 deletions

View file

@ -55,9 +55,12 @@ function Node_Byte_File_Read(_x, _y, _group = noone) : Node(_x, _y, _group) cons
static step = function() { #region
if(attributes.file_checker && file_exists_empty(path_current)) {
if(file_get_modify_s(path_current) > edit_time) {
updatePaths();
triggerRender();
var _modi = file_get_modify_s(path_current);
if(_modi > edit_time) {
edit_time = _modi;
run_in(2, function() { updatePaths(); triggerRender(); });
}
}
} #endregion

View file

@ -106,9 +106,12 @@ function Node_CSV_File_Read(_x, _y, _group = noone) : Node(_x, _y, _group) const
static step = function() { #region
if(attributes.file_checker && file_exists_empty(path_current)) {
if(file_get_modify_s(path_current) > edit_time) {
updatePaths();
triggerRender();
var _modi = file_get_modify_s(path_current);
if(_modi > edit_time) {
edit_time = _modi;
run_in(2, function() { updatePaths(); triggerRender(); });
}
}
} #endregion

View file

@ -144,9 +144,12 @@ function Node_Image_gif(_x, _y, _group = noone) : Node(_x, _y, _group) construct
}
if(attributes.file_checker && file_exists_empty(path_current)) {
if(file_get_modify_s(path_current) > edit_time) {
updatePaths();
triggerRender();
var _modi = file_get_modify_s(path_current);
if(_modi > edit_time) {
edit_time = _modi;
run_in(2, function() { updatePaths(); triggerRender(); });
}
}

View file

@ -87,9 +87,12 @@ function Node_Json_File_Read(_x, _y, _group = noone) : Node(_x, _y, _group) cons
static step = function() { #region
if(attributes.file_checker && file_exists_empty(path_current)) {
if(file_get_modify_s(path_current) > edit_time) {
updatePaths();
triggerRender();
var _modi = file_get_modify_s(path_current);
if(_modi > edit_time) {
edit_time = _modi;
run_in(2, function() { updatePaths(); triggerRender(); });
}
}
} #endregion

View file

@ -89,10 +89,7 @@ function Node_Text_File_Read(_x, _y, _group = noone) : Node(_x, _y, _group) cons
if(_modi > edit_time) {
edit_time = _modi;
run_in(2, function() {
updatePaths();
triggerRender();
});
run_in(2, function() { updatePaths(); triggerRender(); });
}
}
} #endregion

View file

@ -194,9 +194,12 @@ function Node_WAV_File_Read(_x, _y, _group = noone) : Node(_x, _y, _group) const
}
if(attributes.file_checker && file_exists_empty(path_current)) {
if(file_get_modify_s(path_current) > edit_time) {
updatePaths();
triggerRender();
var _modi = file_get_modify_s(path_current);
if(_modi > edit_time) {
edit_time = _modi;
run_in(2, function() { updatePaths(); triggerRender(); });
}
}
} #endregion