@servable/server
Version:
Servable server
18 lines (15 loc) • 321 B
JavaScript
import ping from "./ping.js"
export default async (props) => {
const { delay = 5000 } = props
loopInfinitely({
delay,
fn: async () => ping(props)
})
}
const loopInfinitely = async (props) => {
const { delay, fn } = props
setTimeout(async () => {
await fn()
loopInfinitely(props)
}, delay)
}