utilitas 1990.1.37 → 1990.1.40
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/event.mjs +1 -2
- package/lib/manifest.mjs +1 -1
- package/lib/sentinel.mjs +2 -1
- package/package.json +1 -1
- package/.github/workflows/npm-publish.yml +0 -33
package/lib/event.mjs
CHANGED
|
@@ -44,13 +44,12 @@ const exec = async () => {
|
|
|
44
44
|
const loop = async (func, interval, tout, delay, name, options) => {
|
|
45
45
|
timer = timer || log('Initialized.') || setInterval(exec, 1000 * 1);
|
|
46
46
|
log('Scheduled.', (name = name || uuidv4()), { force: true });
|
|
47
|
-
await timeout((delay = sToMs(delay)));
|
|
48
47
|
jobs[name] = {
|
|
49
48
|
function: func,
|
|
50
49
|
interval: sToMs(interval),
|
|
51
50
|
timeout: sToMs(tout),
|
|
52
51
|
delay: delay,
|
|
53
|
-
lastRun:
|
|
52
|
+
lastRun: Date.now() + sToMs(delay - interval),
|
|
54
53
|
lock: 0,
|
|
55
54
|
silent: !!options?.silent,
|
|
56
55
|
end: options?.end,
|
package/lib/manifest.mjs
CHANGED
package/lib/sentinel.mjs
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { isPrimary } from 'cluster';
|
|
1
2
|
import { log as _log } from './utilitas.mjs';
|
|
2
3
|
|
|
3
4
|
const log = (content) => _log(content, import.meta.url);
|
|
@@ -13,7 +14,7 @@ const init = async (options) => {
|
|
|
13
14
|
if (options) {
|
|
14
15
|
sentry = await import('@sentry/node');
|
|
15
16
|
sentry.init(Object.assign({ integrations }, options));
|
|
16
|
-
|
|
17
|
+
isPrimary && !options.silent && log(`Initialized, dsn: ${options.dsn} .`);
|
|
17
18
|
}
|
|
18
19
|
assert(sentry, 'Sentry has not been initialized.', 501);
|
|
19
20
|
return sentry;
|
package/package.json
CHANGED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
# This workflow will run tests using node and then publish a package to GitHub Packages when a release is created
|
|
2
|
-
# For more information see: https://help.github.com/actions/language-and-framework-guides/publishing-nodejs-packages
|
|
3
|
-
|
|
4
|
-
name: Node.js Package
|
|
5
|
-
|
|
6
|
-
on:
|
|
7
|
-
push:
|
|
8
|
-
branches: [ master ]
|
|
9
|
-
pull_request:
|
|
10
|
-
branches: [ master ]
|
|
11
|
-
|
|
12
|
-
jobs:
|
|
13
|
-
build:
|
|
14
|
-
runs-on: ubuntu-latest
|
|
15
|
-
if: "!startsWith(github.event.head_commit.message, '[RELEASE]')"
|
|
16
|
-
steps:
|
|
17
|
-
- uses: actions/checkout@v3
|
|
18
|
-
with:
|
|
19
|
-
token: ${{ secrets.GITHUB_TOKEN }}
|
|
20
|
-
- uses: actions/setup-node@v3
|
|
21
|
-
with:
|
|
22
|
-
node-version: 18
|
|
23
|
-
registry-url: https://registry.npmjs.org/
|
|
24
|
-
- run: git config --global user.name 'Leask Wong'
|
|
25
|
-
- run: git config --global user.email 'i@leaskh.com'
|
|
26
|
-
- run: npm version patch -m "[RELEASE] %s"
|
|
27
|
-
- run: git push
|
|
28
|
-
- run: npm install
|
|
29
|
-
- run: node build.mjs
|
|
30
|
-
- run: npm test
|
|
31
|
-
- run: npm publish
|
|
32
|
-
env:
|
|
33
|
-
NODE_AUTH_TOKEN: ${{secrets.npm_token}}
|