Skip to content

Commit 691fa2e

Browse files
committed
Tidyup get_cache and get_remote
1 parent 8ad6f8d commit 691fa2e

2 files changed

Lines changed: 4 additions & 7 deletions

File tree

ybd/assembly.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,15 +30,12 @@
3030
def assemble(defs, target):
3131
'''Assemble dependencies and contents recursively until target exists.'''
3232

33-
if cache.get_cache(defs, target):
34-
return cache.cache_key(defs, target)
35-
36-
random.seed(datetime.datetime.now())
3733
component = defs.get(target)
38-
if cache.get_remote_artifact(defs, component):
39-
app.config['counter'] += 1
34+
if cache.get_cache(defs, component) or cache.get_remote(defs, component):
4035
return cache.cache_key(defs, component)
4136

37+
random.seed(datetime.datetime.now())
38+
4239
if component.get('arch') and component['arch'] != app.config['arch']:
4340
app.log(target, 'Skipping assembly for', component.get('arch'))
4441
return None

ybd/cache.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ def get_cache(defs, this):
172172
return False
173173

174174

175-
def get_remote_artifact(defs, this):
175+
def get_remote(defs, this):
176176
''' If a remote cached artifact exists for this, retrieve it '''
177177
if app.config.get('kbas-url', 'http://foo.bar/') == 'http://foo.bar/':
178178
return False

0 commit comments

Comments
 (0)