Skip to content

Commit

Permalink
debt - use native promise for pfs#whenDeleted
Browse files Browse the repository at this point in the history
  • Loading branch information
jrieken committed Nov 22, 2018
1 parent fec5e17 commit 3dded63
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/vs/base/node/pfs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -182,10 +182,10 @@ export function del(path: string, tmp = getTmpDir()): Promise<void> {
return nfcall(extfs.del, path, tmp);
}

export function whenDeleted(path: string): TPromise<void> {
export function whenDeleted(path: string): Promise<void> {

// Complete when wait marker file is deleted
return new TPromise<void>(c => {
return new Promise<void>(resolve => {
let running = false;
const interval = setInterval(() => {
if (!running) {
Expand All @@ -195,7 +195,7 @@ export function whenDeleted(path: string): TPromise<void> {

if (!exists) {
clearInterval(interval);
c(void 0);
resolve(void 0);
}
});
}
Expand Down

0 comments on commit 3dded63

Please sign in to comment.