webbit Posted August 9, 2020 Posted August 9, 2020 Hello! I created a sort of Scheduler app to control a Broadcast Video Server via API. After a while (about 3 weeks) it stops running. Since last problem, i added some trace to help me figure out what is the problem. It failed last week and i am unable to figure out what went on. Let me present parts of the code below that represent the heart of the app. Part1: The Tray Icon Items Even if this part is non trivial for the App, it allowed me to figure out that when the app seems to be inactive i am still able to see and act with the Tray Items and they work! Opt("TrayAutoPause", 0) ;0=no pause, 1=Pause Opt("TrayOnEventMode", 1) ;0=disable, 1=enable Opt("TrayMenuMode", 3) TrayCreateItem("Lancer " & $sServerAddress) TrayItemSetOnEvent(-1, "_Browser") TrayCreateItem("") ; Create a separator line. TrayCreateItem("Test-Debug App") TrayItemSetOnEvent(-1, "_TestScript") TrayCreateItem("") ; Create a separator line. TrayCreateItem("Quit App") TrayItemSetOnEvent(-1, "_ExitScript1") TraySetState(1) ; Show the tray menu. TraySetToolTip("CaptureScheduler") Part2: AdlibRegister ("_EachSecondTimer" ,1000) AdlibRegister ("_DelayTimer" ,int($TimerDelay*1000)) AdlibRegister ("_MultipliedDelayTimer" ,int(($TimerDelay*1000)*$TimerMultiplier)) The Heart of the App runs on 3 triggers + the Background running loop(see below) -One, each second -The second, predefined Delay (ex.: 10sec) -The third, predefined Delay Multiplied by a Factor (ex.: 10sec x 3) When each of these triggers, i write a Timestamp Marker to a ini file, so i can see which part would/could fail once the problematic state has been detected. Last week, All of them stopped updating the ini inside the same minute .. (even the the Background running loop marker/timestamp) See the code below... expandcollapse popuplocal $LoopCounter=0 While 1 sleep(100) $LoopCounter=$LoopCounter+1 if $LoopCounter > 100 Then if IniRead($Path & "Capture.ini","Config","Get_Heartbeat",0) =1 then iniwrite($Path & "Capture.ini","Config","Heartbeat1", @YEAR & "-" & @MON & "-" & @MDAY & " " & @HOUR & ":" & @MIN & ":" & @SEC) endif $LoopCounter=0 endif Wend Func _EachSecondTimer() _IsItTime() _ManageDEL() _ManageADD() _ManageROUTE() _ManageStop() if IniRead($Path & "Capture.ini","Config","Get_Heartbeat",0) =1 then iniwrite($Path & "Capture.ini","Config","Heartbeat0", @YEAR & "-" & @MON & "-" & @MDAY & " " & @HOUR & ":" & @MIN & ":" & @SEC) Else iniwrite($Path & "Capture.ini","Config","Heartbeat0","") endif endfunc Func _DelayTimer() if IniRead($Path & "Capture.ini","Config","Get_Heartbeat",0) =1 then iniwrite($Path & "Capture.ini","Config","Heartbeat", @YEAR & "-" & @MON & "-" & @MDAY & " " & @HOUR & ":" & @MIN & ":" & @SEC) elseif IniRead($Path & "Capture.ini","Config","Get_Heartbeat",0) = 0 then if IniRead($Path & "Capture.ini","Config","Heartbeat","") <> "" then iniwrite($Path & "Capture.ini","Config","Heartbeat","") endif endif endfunc Func _MultipliedDelayTimer() if IniRead($Path & "Capture.ini","Config","Get_Heartbeat",0) =1 then iniwrite($Path & "Capture.ini","Config","Heartbeat2", @YEAR & "-" & @MON & "-" & @MDAY & " " & @HOUR & ":" & @MIN & ":" & @SEC) endif _GenerateUserLogPage() if @compiled = 1 then _UpdateStatus() $MultipleTimes=0 _TimelinejsonMaker() endfunc Obviously, some may say that i come from the functions called each seconds: _IsItTime() , _ManageDEL() , _ManageADD() , _ManageROUTE() , _ManageSTOP() And i don't disagree. However, if the "once a seconds" function, called by the AdlibRegister gets stuck, does it also stuck the other AdlibRegisters to trigger? Maybe i should add an additional Timestamps around the Functions to figure out if the issues occurs in/between them. Anyone see an other possibility? Thanks
Developers Jos Posted August 9, 2020 Developers Posted August 9, 2020 7 hours ago, webbit said: However, if the "once a seconds" function, called by the AdlibRegister gets stuck, does it also stuck the other AdlibRegisters to trigger? Yes, AutoIt is single threaded. Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past.
Dan_555 Posted August 9, 2020 Posted August 9, 2020 Hi, here is a script, which i think will be useful in debugging your script: DebugLogText Some of my script sourcecode
Nine Posted August 9, 2020 Posted August 9, 2020 Have you checked your AV ? I had a similar problem last year, a process that was running fine stopped all of the sudden. Of course, that was a false positive... “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Debug Messages Monitor UDF Screen Scraping Round Corner GUI UDF Multi-Threading Made Easy Interface Object based on Tag
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now