[Sync] Settings uses common provider
This commit is contained in:
1 parent
7aad93b963
commit
ad96fed675
3 files changed
+4
-3
No files matched your search
@@ -139,7 +139,7 @@ provider_root = value('provider')['root'] # env('SYNC_PROVIDER', 'fs')
|
|||||||
|
|
||||||
f = abs_fn(provider_root)
|
f = abs_fn(provider_root)
|
||||||
|
|
||||||
dir_settings = f('Settings')
|
dir_settings = './Settings'
|
||||||
dir_documents = './Documents'
|
dir_documents = './Documents'
|
||||||
dir_awards = f('Awards')
|
dir_awards = f('Awards')
|
||||||
dir_schedules = f('Schedules')
|
dir_schedules = f('Schedules')
|
||||||
|
|||||||
+1
-1
@@ -78,7 +78,7 @@ async def run(run_interval=0):
|
|||||||
)
|
)
|
||||||
|
|
||||||
sync_settings = Sync(
|
sync_settings = Sync(
|
||||||
provider=io(settings.dir_settings),
|
provider=io(settings.provider_root),
|
||||||
model=Settings,
|
model=Settings,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -22,7 +22,8 @@ class Settings(Model):
|
|||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
async def scan(provider):
|
async def scan(provider):
|
||||||
documents = provider.type_filter('.', '.yaml')
|
scan_dir = settings.dir_settings
|
||||||
|
documents = provider.type_filter(scan_dir, '.yaml')
|
||||||
|
|
||||||
documents = [Settings.read(provider, i) for i in documents]
|
documents = [Settings.read(provider, i) for i in documents]
|
||||||
return documents
|
return documents
|
||||||
|
|||||||
Reference in new issue
Block a user