v0.0.42: таймер в статусе тикает только у текущего файла (остальные останавливаются при start)
Deploy drhider / validate (push) Canceled after 0s
Deploy drhider / validate (push) Canceled after 0s
This commit is contained in:
+1
-1
@@ -20,7 +20,7 @@ if _sys_path_root not in sys.path:
|
|||||||
sys.path.insert(0, _sys_path_root)
|
sys.path.insert(0, _sys_path_root)
|
||||||
|
|
||||||
# Версия приложения (меняется при изменениях)
|
# Версия приложения (меняется при изменениях)
|
||||||
VERSION = "0.0.41"
|
VERSION = "0.0.42"
|
||||||
|
|
||||||
|
|
||||||
def create_app():
|
def create_app():
|
||||||
|
|||||||
@@ -462,6 +462,11 @@ async function uploadFiles() {
|
|||||||
activeES = new EventSource('/api/process_stream/' + currentSid);
|
activeES = new EventSource('/api/process_stream/' + currentSid);
|
||||||
activeES.addEventListener('start', function(e) {
|
activeES.addEventListener('start', function(e) {
|
||||||
const d = JSON.parse(e.data);
|
const d = JSON.parse(e.data);
|
||||||
|
// Таймер тикает ТОЛЬКО у текущего файла; таймеры остальных останавливаем
|
||||||
|
for (const k in fileIntervals) {
|
||||||
|
clearInterval(fileIntervals[k]);
|
||||||
|
delete fileIntervals[k];
|
||||||
|
}
|
||||||
fileTimers[d.idx] = performance.now();
|
fileTimers[d.idx] = performance.now();
|
||||||
fileIntervals[d.idx] = setInterval(function() {
|
fileIntervals[d.idx] = setInterval(function() {
|
||||||
const elapsed = ((performance.now() - fileTimers[d.idx]) / 1000).toFixed(1);
|
const elapsed = ((performance.now() - fileTimers[d.idx]) / 1000).toFixed(1);
|
||||||
|
|||||||
Reference in New Issue
Block a user