mirror of
https://github.com/consbio/mbtileserver.git
synced 2024-09-11 07:15:24 +03:00
Don’t try to load .mbtiles
files during write (#73)
This commit is contained in:
parent
c873e74160
commit
55f887a895
@ -174,6 +174,10 @@ func NewFromBaseDir(baseDir string, secretKey string) (*ServiceSet, error) {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if _, err := os.Stat(p + "-journal"); err == nil {
|
||||
// Don't try to load .mbtiles files that are being written
|
||||
return nil
|
||||
}
|
||||
if ext := filepath.Ext(p); ext == ".mbtiles" {
|
||||
filenames = append(filenames, p)
|
||||
}
|
||||
|
4
main.go
4
main.go
@ -196,6 +196,10 @@ func serve() {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if _, err := os.Stat(path + "-journal"); err == nil {
|
||||
// Don't try to load .mbtiles files that are being written
|
||||
return nil
|
||||
}
|
||||
if strings.HasSuffix(strings.ToLower(path), ".mbtiles") {
|
||||
filenames = append(filenames, path)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user