diff --git a/AsyncKernel.php b/AsyncKernel.php index 239fd49..27b1321 100644 --- a/AsyncKernel.php +++ b/AsyncKernel.php @@ -46,16 +46,15 @@ public function boot() { if (!$this->booted) { $this->uid = $this->generateUID(); - } - - $fs = new Filesystem(); - // AsyncKernel loads the container only once when it loads. Storing it in the filesystem is not for cache purposes - // but more for using the same loading process as Kernel class use. - // Hence, everytime before AsyncKernel initiates the container it deletes the cache dir, - // to make sure it is building the updated kernel - $cachePath = $this->getCacheDir(); - if ($fs->exists($cachePath)) { - $fs->remove($cachePath); + $fs = new Filesystem(); + // AsyncKernel loads the container only once when it loads. Storing it in the filesystem is not for cache purposes + // but more for using the same loading process as Kernel class use. + // Hence, everytime before AsyncKernel initiates the container it deletes the cache dir, + // to make sure it is building the updated kernel + $cachePath = $this->getCacheDir(); + if ($fs->exists($cachePath)) { + $fs->remove($cachePath); + } } parent::boot();