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

Setting timeout seconds #4

Open
SJang1 opened this issue Aug 28, 2024 · 4 comments
Open

Setting timeout seconds #4

SJang1 opened this issue Aug 28, 2024 · 4 comments
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@SJang1
Copy link

SJang1 commented Aug 28, 2024

For the servers which is not responding, it would be a good idea to make a timeout in seconds.
It will also be great if we would able to set the actual timeout time on config.

@yunsii
Copy link
Owner

yunsii commented Aug 28, 2024

I don't know the scenario, and I encounter the status page exceeded CPU time limit recently, So the timeout setting seems no use?

@SJang1
Copy link
Author

SJang1 commented Aug 28, 2024

Actually CPU time limit would make the whole process to die, so that looking for the process to end normally within CPU time. And for Enterprise Workers, CPU time is much longer, so that it takes a long time to reach it. also makes update slower.

@yunsii
Copy link
Owner

yunsii commented Aug 28, 2024

Ok, I can investigate it laterly, and PR is welcome 👀

@yunsii
Copy link
Owner

yunsii commented Sep 1, 2024

Is it resolved by setting timeout for fetch data?

export default async function getRemoteMonitors() {
if (!config.monitorsCsvUrl) {
return []
}
const response = await fetch(config.monitorsCsvUrl, {
cf: {
cacheTtlByStatus: {
// Cache 10 minutes
'200-299': 600,
'404': 1,
'500-599': 0,
},
},
})
const csvString = await response.text()
const parsedResult = Papa.parse(csvString, { header: true, transform: (value, field) => {
if (field === 'followRedirect') {
return !!value
}
return value
} })
return parsedResult.data as Monitor[]
}

@yunsii yunsii added enhancement New feature or request good first issue Good for newcomers labels Sep 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants