Scheduled tasks with no start date or start time should run continuously

Description

I have a need for a server that runs a coldbox application to start running that application whenever the server is launched, without needing to hit it with a web browser first. I understand that there is an onserverstart() function but it's hard to get to and manage with commandbox instances. Much easier would be the following code - when run once, without a start time param, it should create a scheduled task that starts running when the server comes up. Such a task should initialize the application automatically whenever the server is rebooted.

Activity

John Wilson 19 July 2021 at 18:19

Hah. This worked! http url="http://localhost:55297/healthcheck" method="get"{}

John Wilson 19 July 2021 at 18:15

Humbug. [ERROR] lucee.runtime.exp.ExpressionException: No matching function [cfhttp] found

John Wilson 19 July 2021 at 18:07
Edited

This might work, but I need a dynamic way of grabbing the server port.

John Wilson 19 July 2021 at 17:56

I am now wondering if I can write a generic function that uses gettempdirectory() to gather the path to the server folder, check for the existence of a server.cfc file and write one if it doesn’t exist. Is there a way to gather the web servers (ports specifically) that the server knows about on startup from the server context?

Zac Spitzer 19 July 2021 at 17:13
Edited

off the top of my head, only the server context is started automatically, the web context starts on demand (with tomcat) but I’m pretty sure a manually configured tomcat context that can be automatically configured in tomcat to start, maybe undertow has an option to do that too?

Details

Assignee

Reporter

New Issue warning screen

Before you create a new Issue, please post to the mailing list first https://dev.lucee.org

Once the issue has been verified, one of the Lucee team will ask you to file an issue

Affects versions

Priority

Created 19 July 2021 at 16:42
Updated 19 July 2021 at 18:26