Skip to content

Commit e715af4

Browse files
committed
Remove bluebird dependency
Change-type: major
1 parent f3c0451 commit e715af4

2 files changed

Lines changed: 6 additions & 7 deletions

File tree

lib/docker-delta.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
import path from 'node:path';
2-
import Bluebird from 'bluebird';
32
import stream from 'node:stream';
43
import { TypedError } from 'typed-error';
54
import * as rsync from './rsync.js';
65
import * as btrfs from './btrfs.js';
76
import { spawn } from './utils.js';
87
import type Dockerode from 'dockerode';
98
import * as dt from 'docker-toolbelt';
9+
import pTimeout from 'p-timeout';
1010

1111
const DELTA_OUT_OF_SYNC_CODES = [19, 23, 24];
1212

@@ -139,16 +139,16 @@ async function applyBatch(
139139
let p = stream.promises.pipeline(batch, rsyncProcess.stdin!);
140140

141141
if (timeout !== 0) {
142-
p = Bluebird.resolve(p).timeout(timeout);
142+
p = pTimeout(p, { milliseconds: timeout });
143143
}
144144

145145
try {
146146
await p;
147147
log('Batch input stream ended; waiting for rsync...');
148148
try {
149-
await Bluebird.resolve(rsyncProcess.waitAsync()).timeout(
150-
RSYNC_EXIT_TIMEOUT,
151-
);
149+
await pTimeout(rsyncProcess.waitAsync(), {
150+
milliseconds: RSYNC_EXIT_TIMEOUT,
151+
});
152152
log('rsync exited cleanly');
153153
} catch (err) {
154154
log(`Error waiting for rsync to exit: ${err}`);

package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
"license": "Apache-2.0",
1818
"devDependencies": {
1919
"@balena/lint": "^9.3.12",
20-
"@types/bluebird": "^3.5.42",
2120
"@types/dockerode": "^4.0.1",
2221
"@types/node": "^22.19.8",
2322
"chai": "^6.2.2",
@@ -30,9 +29,9 @@
3029
"typescript": "^5.9.3"
3130
},
3231
"dependencies": {
33-
"bluebird": "^3.7.2",
3432
"docker-toolbelt": "^7.0.0",
3533
"dockerode": "^4.0.9",
34+
"p-timeout": "^7.0.1",
3635
"tmp-promise": "^3.0.3",
3736
"typed-error": "^3.2.2"
3837
},

0 commit comments

Comments
 (0)