Revert "Allow rendering static files to disk and dynamic to memory in server mode"

This reverts commit 7d8011ed63.

Updates #9647
This commit is contained in:
Bjørn Erik Pedersen
2022-03-11 09:48:20 +01:00
parent 5ef8a9f32c
commit 64b7b7a897
8 changed files with 25 additions and 69 deletions

View File

@@ -56,9 +56,6 @@ func (s *staticSyncer) syncsStaticEvents(staticEvents []fsnotify.Event) error {
syncer.ChmodFilter = chmodFilter
syncer.SrcFs = sourceFs.Fs
syncer.DestFs = c.Fs.Destination
if c.renderStaticToDisk {
syncer.DestFs = c.Fs.DestinationStatic
}
// prevent spamming the log on changes
logger := helpers.NewDistinctErrorLogger()
@@ -104,11 +101,7 @@ func (s *staticSyncer) syncsStaticEvents(staticEvents []fsnotify.Event) error {
toRemove := filepath.Join(publishDir, relPath)
logger.Println("File no longer exists in static dir, removing", toRemove)
if c.renderStaticToDisk {
_ = c.Fs.DestinationStatic.RemoveAll(toRemove)
} else {
_ = c.Fs.Destination.RemoveAll(toRemove)
}
_ = c.Fs.Destination.RemoveAll(toRemove)
} else if err == nil {
// If file still exists, sync it
logger.Println("Syncing", relPath, "to", publishDir)