I'm playing with using a threaded timer to set fla...
# lucee
t
I'm playing with using a threaded timer to set flags in CommandBox - which works well, except that the thread doesn't terminate with the job...
Copy code
thread name="timer" {
			application.jobNotify("Timer started");
			while (true) {
				if( timeFormat( now(), "HH:mm" ) == "09:47" || timeFormat( now(), "HH:mm" ) == "21:47" ){
					application.jobNotify("It's #timeFormat( now(), "HH:mm" )#");
					lvPush = true;
					lv2Push = true;
					asPush = true;
					dp360Push = true;
					as2Push = true;
					cttPush = true;
					cfsPush = true;
				}
				if( timeFormat( now(), "HH:mm" ) == "06:47" ){
					application.jobNotify("It's #timeFormat( now(), "HH:mm" )#");
					zdPush = true;
				}
				sleep(60000);
			}
		}
f
you will need to add a
break;
condition to that
while(true)
loop
t
Interesting thought. I'll have to set a flag in the main thread and break when it's set.
You would think
Copy code
threadTerminate("timer");
Would resolve this, but it doesn't.
Well... that broke everything. Looks like I'll need to reboot before attempting the task run again
Copy code
ERROR (5.5.2+00578)

Expecting a stackmap frame at branch target 10Exception Details:Location:sites/dealsector/dsom/ds_cfc$cf$2.udfCall(Llucee/runtime/PageContext;Llucee/runtime/type/UDF;I)Ljava/lang/Object; @3: if_icmpltReason:Expected stackmap frame at this location.Bytecode:0000000: 1d10 0aa1 0007 03a7 0004 0499 000e 2a2b0000010: 2c1d b601 27b0 a700 1c1d 1014 a100 07030000020: a700 0404 9900 0e2a 2b2c 1db6 012a b0a70000030: 0003 01b0
  caused by: java.lang.VerifyError
  Expecting a stackmap frame at branch target 10
Exception Details:
  Location:
    sites/dealsector/dsom/ds_cfc$cf$2.udfCall(Llucee/runtime/PageContext;Llucee/runtime/type/UDF;I)Ljava/lang/Object; @3: if_icmplt
  Reason:
    Expected stackmap frame at this location.
  Bytecode:
    0000000: 1d10 0aa1 0007 03a7 0004 0499 000e 2a2b
    0000010: 2c1d b601 27b0 a700 1c1d 1014 a100 0703
    0000020: a700 0404 9900 0e2a 2b2c 1db6 012a b0a7
    0000030: 0003 01b0
z
which version?