File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11import path from 'node:path' ;
2- import Bluebird from 'bluebird' ;
32import stream from 'node:stream' ;
43import { TypedError } from 'typed-error' ;
54import * as rsync from './rsync.js' ;
65import * as btrfs from './btrfs.js' ;
76import { spawn } from './utils.js' ;
87import type Dockerode from 'dockerode' ;
98import * as dt from 'docker-toolbelt' ;
9+ import pTimeout from 'p-timeout' ;
1010
1111const 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 } ` ) ;
Original file line number Diff line number Diff line change 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" ,
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 },
You can’t perform that action at this time.
0 commit comments