Skip to content

Commit

Permalink
fix: add classGraphScanner close to the end
Browse files Browse the repository at this point in the history
  • Loading branch information
MoeQuadrat committed Aug 12, 2022
1 parent 8c37aa6 commit 8e0ae33
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@ class AutoRouter @Inject(
val classGraphScanner: ScanResult = new ClassGraph().enableAllInfo().acceptPackages(pkg).scan()
val controllers = classGraphScanner.getClassesImplementing(classOf[AutoRoutableController])
logger.debug(s"[AutoRouter] found ${controllers.size()} Controllers")
controllers.asScala.map(_.loadClass(true)).map(clazz => createFromClass(clazz)).toSeq
val routes = controllers.asScala.map(_.loadClass(true)).map(clazz => createFromClass(clazz)).toSeq
classGraphScanner.close()
routes
}

def createFromClass(clazz: Class[_]): Routes =
Expand Down

0 comments on commit 8e0ae33

Please sign in to comment.