Null check for old
This commit is contained in:
parent
cc759d5268
commit
786cfb9d24
3 changed files with 3 additions and 3 deletions
|
@ -1,5 +1,5 @@
|
||||||
# hot
|
# hot
|
||||||
[![version 1.0.0-rc.1](https://img.shields.io/badge/pub-1.0.0--rc.1-brightgreen.svg)](https://pub.dartlang.org/packages/angel_rethink)
|
[![version 1.0.0-rc.2](https://img.shields.io/badge/pub-1.0.0--rc.2-brightgreen.svg)](https://pub.dartlang.org/packages/angel_rethink)
|
||||||
|
|
||||||
Supports *hot reloading* of Angel servers on file changes. This is faster and
|
Supports *hot reloading* of Angel servers on file changes. This is faster and
|
||||||
more reliable than merely reactively restarting a `Process`.
|
more reliable than merely reactively restarting a `Process`.
|
||||||
|
|
|
@ -177,8 +177,8 @@ class HotReloader {
|
||||||
_handleWatchEvent(WatchEvent e) async {
|
_handleWatchEvent(WatchEvent e) async {
|
||||||
print('${e.path} changed. Reloading server...');
|
print('${e.path} changed. Reloading server...');
|
||||||
var old = _server;
|
var old = _server;
|
||||||
|
if (old != null) Future.forEach(old.justBeforeStop, old.configure);
|
||||||
_server = null;
|
_server = null;
|
||||||
Future.forEach(old.justBeforeStop, old.configure);
|
|
||||||
|
|
||||||
_client ??=
|
_client ??=
|
||||||
new VMServiceClient.connect(vmServiceUrl ?? 'ws://localhost:8181/ws');
|
new VMServiceClient.connect(vmServiceUrl ?? 'ws://localhost:8181/ws');
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
name: angel_hot
|
name: angel_hot
|
||||||
description: Supports hot reloading of Angel servers on file changes.
|
description: Supports hot reloading of Angel servers on file changes.
|
||||||
version: 1.0.0-rc.1
|
version: 1.0.0-rc.2
|
||||||
author: Tobe O <thosakwe@gmail.com>
|
author: Tobe O <thosakwe@gmail.com>
|
||||||
homepage: https://github.com/angel-dart/hot
|
homepage: https://github.com/angel-dart/hot
|
||||||
environment:
|
environment:
|
||||||
|
|
Loading…
Reference in a new issue