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

Add a time debounce property #31

Open
10hendersonm opened this issue Nov 23, 2021 · 0 comments
Open

Add a time debounce property #31

10hendersonm opened this issue Nov 23, 2021 · 0 comments

Comments

@10hendersonm
Copy link
Member

10hendersonm commented Nov 23, 2021

It'd be cool if blocks could only be updated every so often, so as to prevent long operations from being run all the time. For example, in our product markdown-inject runs on precommit, but it could be beneficial to have some emitted blocks of some components' npm run build output. It's not really something that changes so often that it need be evaluated every time, but running it every month or two could be nice.

<!--
  CODEBLOCK_START
  {
    "type": "command",
    "debounce": "1 month",
    "value": "npm run build"
  }
-->

To reduce complication / dependencies, the debounce property could instead take a number of minutes (43200), seconds (2592000), milliseconds (2592000), or something.

Then, markdown-inject would automatically inject a last-update property into the JSON config when it runs for that block:

<!--
  CODEBLOCK_START
  {
    "type": "command",
    "debounce": "1 month",
    "value": "npm run build",
    "last-update": "2021-11-23T22:43:35.339Z"
  }
-->

Preferably this date would be captured with new Date().toISOString() so the date is both easily machine parseable, but also decently human readable.

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