Better caching mechanics

This commit is contained in:
2022-08-02 22:35:37 +09:00
parent 00180c815d
commit 70618b6b91
7 changed files with 104 additions and 38 deletions

View File

@@ -4,11 +4,11 @@ import os
from sys import platform
from tempfile import NamedTemporaryFile
from botanjs.config import Config as config
from botanjs.service.jwork import log
COMPILER = config[ "BotanJS" ][ "ClosureCompiler" ]
if not os.path.isfile( COMPILER ):
raise Exception( "Compiler not found" )
AVAILABLE = os.path.isfile( COMPILER )
COMPILER_OPTIONS = [
@@ -42,6 +42,11 @@ class Wrapper:
break
def compress( self, loc ):
if not AVAILABLE:
log.error( "Compiler not found" )
return
content = ""
with open( loc, "rb" ) as f:
content = f.read()