Sub refresh_check
Log(refreshtimer * 1000) ' currently set to 10 (seconds)
Do While 1 = 1
Log("tick")
Sleep(refreshtimer * 1000) '60000 = 1 min
Dim req As DBRequestManager = CreateRequest
Dim cmd As DBCommand = CreateCommand("check_refresh", Array(prepid, jdgnumber))
Wait For (req.ExecuteQuery(cmd, 0, Null)) JobDone(j As HttpJob)
If j.Success Then
req.HandleJobAsync(j, "req")
Wait For (req) req_Result(res As DBResult)
Dim row() As Object = res.Rows.Get(0)
If row(0) = 1 Then
Log("do refresh")
Refresh_Click
End If
End If
j.release
Loop
End Sub