mirror of
https://github.com/justUmen/Bjornulf_custom_nodes.git
synced 2026-03-25 14:25:44 -03:00
0.70
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import time
|
||||
from aiohttp import web
|
||||
from server import PromptServer
|
||||
import logging
|
||||
# import logging
|
||||
from pydub import AudioSegment
|
||||
from pydub.playback import play
|
||||
import os
|
||||
@@ -61,7 +61,7 @@ class PauseResume:
|
||||
self.play_audio()
|
||||
self.input = input
|
||||
while PauseResume.is_paused and not PauseResume.should_stop:
|
||||
logging.info(f"PauseResume.is_paused: {PauseResume.is_paused}, PauseResume.should_stop: {PauseResume.should_stop}")
|
||||
# logging.info(f"PauseResume.is_paused: {PauseResume.is_paused}, PauseResume.should_stop: {PauseResume.should_stop}")
|
||||
time.sleep(1) # Sleep to prevent busy waiting
|
||||
|
||||
if PauseResume.should_stop:
|
||||
@@ -75,13 +75,13 @@ class PauseResume:
|
||||
|
||||
@PromptServer.instance.routes.get("/bjornulf_resume")
|
||||
async def resume_node(request):
|
||||
logging.info("Resume node called")
|
||||
# logging.info("Resume node called")
|
||||
PauseResume.is_paused = False
|
||||
return web.Response(text="Node resumed")
|
||||
|
||||
@PromptServer.instance.routes.get("/bjornulf_stop")
|
||||
async def stop_node(request):
|
||||
logging.info("Stop node called")
|
||||
# logging.info("Stop node called")
|
||||
PauseResume.should_stop = True
|
||||
PauseResume.is_paused = False # Ensure the loop exits
|
||||
return web.Response(text="Workflow stopped")
|
||||
Reference in New Issue
Block a user