Skip to content

Commit

Permalink
o
Browse files Browse the repository at this point in the history
  • Loading branch information
bung87 committed Apr 1, 2020
1 parent fe34cd9 commit fcf0a3b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
11 changes: 7 additions & 4 deletions lib/apps/ruby.dart
Original file line number Diff line number Diff line change
Expand Up @@ -30,17 +30,20 @@ class RubyTask extends Task {
// this.eventBus.fire(TaskData(this.app, e.toString()));
// } );
ReceivePort receivePort = ReceivePort();
var isolate = await Isolate.spawn(runGetDirectorySize, receivePort.sendPort);
var isolate = await Isolate.spawn(runGetDirectorySize, receivePort.sendPort,
onExit: receivePort.sendPort);

receivePort.listen((data) {
isolate.kill(priority: 0);
_scan(data);

});
}

_scan(out) async {
if(out == null){
if (out == null) {
this.eventBus.fire(TaskData(this.app, "empty"));
this
.eventBus
.fire(TaskState(this.app, TaskStatus.done, TaskType.scan, 0));
return;
}
// final days = new DateTime.now().subtract(new Duration(days: 90));
Expand Down
4 changes: 3 additions & 1 deletion lib/apps/ruby_utils.dart
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ filesInDirectoryWithDepth(Directory dir, FileSystemEntityType typ,
entity, typ, currentLevel + 1, maxLevel,sendPort);
}
}
} catch (e) {}
} catch (e) {
print(e);
}
}
}

0 comments on commit fcf0a3b

Please sign in to comment.