utilitas 1990.1.38 → 1990.1.41

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 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: 0,
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
@@ -1,7 +1,7 @@
1
1
  const manifest = {
2
2
  "name": "utilitas",
3
3
  "description": "Just another common utility for JavaScript.",
4
- "version": "1990.1.38",
4
+ "version": "1990.1.41",
5
5
  "private": false,
6
6
  "homepage": "https://github.com/Leask/utilitas",
7
7
  "main": "index.mjs",
package/lib/tape.mjs CHANGED
@@ -1,5 +1,6 @@
1
1
  import { default as color } from './color.mjs';
2
2
  import { end as eventEnd, loop } from './event.mjs';
3
+ import { isPrimary } from 'cluster';
3
4
  import { send } from './bot.mjs';
4
5
 
5
6
  import {
@@ -82,9 +83,9 @@ const init = async (options) => {
82
83
  bufferCycle = ensureInt(
83
84
  options?.bufferCycle || defBufCycle, { min: 1, max: maxBufCycle }
84
85
  );
85
- if (!options?.silent) {
86
- log(`Sending logs via bot, chatId: ${chatIds.join(', ')}.`);
87
- }
86
+ isPrimary && !options?.silent && log(
87
+ `Sending logs via bot, chatId: ${chatIds.join(', ')}.`
88
+ );
88
89
  extLog = rawLog;
89
90
  await loop(
90
91
  sync, ~~options?.interval || 5, ~~options?.tout || 10,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "utilitas",
3
3
  "description": "Just another common utility for JavaScript.",
4
- "version": "1990.1.38",
4
+ "version": "1990.1.41",
5
5
  "private": false,
6
6
  "homepage": "https://github.com/Leask/utilitas",
7
7
  "main": "index.mjs",
@@ -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}}