Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: allow marketplace/services to set it's own timeout #205

Open
alehostert opened this issue Jan 23, 2025 · 0 comments
Open

fix: allow marketplace/services to set it's own timeout #205

alehostert opened this issue Jan 23, 2025 · 0 comments

Comments

@alehostert
Copy link
Member

The CreateScheduledTask DTO have a property called TimeoutSecs:

type CreateScheduledTask struct {
Name valueObject.ScheduledTaskName `json:"name"`
Command valueObject.UnixCommand `json:"command"`
Tags []valueObject.ScheduledTaskTag `json:"tags"`
TimeoutSecs *uint16 `json:"timeoutSecs,omitempty"`
RunAt *valueObject.UnixTime `json:"runAt,omitempty"`
}

The default value for the timeout is 600, as we can see in the implementations of services and marketplace:

timeoutSeconds := uint16(600)
scheduledTaskCreateDto := dto.NewCreateScheduledTask(
taskName, taskCmd, taskTags, &timeoutSeconds, nil,
)

timeoutSeconds := uint16(600)
scheduledTaskCreateDto := dto.NewCreateScheduledTask(
taskName, taskCmd, taskTags, &timeoutSeconds, nil,
)

The proposal of this issue is to allow marketplace/services itens to set it's own timeout, adding a new timeout (or any more suitable name) property to the Manifest/Schema.

The resoanable behind this is that some complex systems will get longer to install and the 600s seconds are not enough to the task to complete. Take n8n as example:

root@172884ae19ab:/app/html# time mise x node@20 -- npm install n8n
gpg: Signature made Tue Jan 21 16:54:47 2025 UTC
gpg:                using RSA key 890C08DB8579162FEE0DF9DB8BEAB4DFCF555EF4
gpg: Good signature from "RafaelGSS <[email protected]>" [expired]
npm warn deprecated [email protected]: This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.
npm warn deprecated [email protected]: This package is no longer supported.
npm warn deprecated [email protected]: This package is no longer supported.
npm warn deprecated @npmcli/[email protected]: This functionality has been moved to @npmcli/fs
npm warn deprecated [email protected]: Rimraf versions prior to v4 are no longer supported
npm warn deprecated [email protected]: This package is no longer supported.
npm warn deprecated @aws-sdk/[email protected]: This package has moved to @smithy/node-http-handler
npm warn deprecated @azure/[email protected]: This package is no longer supported. Please refer to https://github.com/Azure/azure-sdk-for-js/blob/490ce4dfc5b98ba290dee3b33a6d0876c5f138e2/sdk/core/README.md
npm warn deprecated [email protected]: dommatrix is no longer maintained. Please use @thednp/dommatrix.
npm warn deprecated [email protected]: Package is no longer maintained
npm warn deprecated @aws-sdk/[email protected]: This package has moved to @smithy/signature-v4
npm warn deprecated @aws-sdk/[email protected]: This package has moved to @smithy/protocol-http
npm warn deprecated [email protected]: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.
npm warn deprecated [email protected]: Glob versions prior to v9 are no longer supported
npm warn deprecated [email protected]: Glob versions prior to v9 are no longer supported
npm warn deprecated [email protected]: Glob versions prior to v9 are no longer supported
npm warn deprecated [email protected]: Rimraf versions prior to v4 are no longer supported
npm warn deprecated [email protected]: Glob versions prior to v9 are no longer supported
npm warn deprecated [email protected]: Glob versions prior to v9 are no longer supported
npm warn deprecated [email protected]: Glob versions prior to v9 are no longer supported

added 2150 packages in 5m

195 packages are looking for funding
  run `npm fund` for details
npm notice
npm notice New major version of npm available! 10.8.2 -> 11.0.0
npm notice Changelog: https://github.com/npm/cli/releases/tag/v11.0.0
npm notice To update run: npm install -g [email protected]
npm notice

real	5m35.971s
user	2m41.475s
sys	0m45.573s
root@172884ae19ab:/app/html#

Allowing the marketplace/service item to define the time it needs to complete will be great.
Obviously, some default and sanity checks would be nice to add either.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant