Skip to content

Commit

Permalink
Described preload API doc
Browse files Browse the repository at this point in the history
  • Loading branch information
g4s8 committed Jul 6, 2021
1 parent b1270b3 commit 6403a23
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion licensedb/licensedb.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,12 @@ func Detect(fs filer.Filer) (map[string]api.Match, error) {
return licenses, nil
}

// Preload database with licenses
// Preload database with licenses - load internal database from assets into memory.
// This method is an optimization for cases when the `Detect` method should return fast,
// e.g. in HTTP web servers where connection timeout can occur during detect
// `Preload` method could be called before server startup.
// This method os optional and it's not required to be called, other APIs loads license database
// lazily on first invocation.
func Preload() {
internal.Preload()
}

0 comments on commit 6403a23

Please sign in to comment.