mirror of
git://git.yoctoproject.org/layerindex-web.git
synced 2025-07-19 20:59:01 +02:00
update_layer.py: move the location of transaction.atomic()
It doesn't need to be so ahead since we only need it when writing database, and a following patch will remove layerbranch from database when the branch had been removed from the repo, it's not easy to do the work in transaction.atomic() block. Signed-off-by: Robert Yang <liezhi.yang@windriver.com> Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
This commit is contained in:
parent
de4400674d
commit
b478ff069e
|
@ -238,8 +238,6 @@ def main():
|
|||
# why won't they just fix that?!)
|
||||
tinfoil.config_data.setVar('LICENSE', '')
|
||||
|
||||
try:
|
||||
with transaction.atomic():
|
||||
layer = utils.get_layer(options.layer)
|
||||
urldir = layer.get_fetch_dir()
|
||||
repodir = os.path.join(fetchdir, urldir)
|
||||
|
@ -268,6 +266,8 @@ def main():
|
|||
logger.info("Skipping update of layer %s - branch %s doesn't exist" % (layer.name, branchdesc))
|
||||
sys.exit(1)
|
||||
|
||||
try:
|
||||
with transaction.atomic():
|
||||
newbranch = False
|
||||
if not layerbranch:
|
||||
# LayerBranch doesn't exist for this branch, create it
|
||||
|
|
Loading…
Reference in New Issue
Block a user