This commit is contained in:
parent
c8cbebb7f9
commit
bff4c107c1
4
main.go
4
main.go
@ -42,7 +42,7 @@ var (
|
|||||||
|
|
||||||
// Preload cached list of files and hashes
|
// Preload cached list of files and hashes
|
||||||
func init() {
|
func init() {
|
||||||
romCache := ROMCache{}
|
romCache = ROMCache{}
|
||||||
romCache.Cached = make(map[string]bool)
|
romCache.Cached = make(map[string]bool)
|
||||||
go updateROMCache("public")
|
go updateROMCache("public")
|
||||||
}
|
}
|
||||||
@ -81,7 +81,7 @@ func updateROMCache(romDirectory string) {
|
|||||||
|
|
||||||
// skip already cached files
|
// skip already cached files
|
||||||
romCache.Lock()
|
romCache.Lock()
|
||||||
if romCache.Cached[d.Name()] {
|
if _, ok := romCache.Cached[d.Name()]; ok {
|
||||||
romCache.Unlock()
|
romCache.Unlock()
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user