feat(replication): handle error outside the data protocol

refactor(replication): remove background worker
This commit is contained in:
Swann 2020-11-13 14:15:11 +01:00
parent 320745aab3
commit 8f4de7adbf
No known key found for this signature in database
GPG Key ID: E1D3641A7C43AACB
2 changed files with 15 additions and 9 deletions

View File

@ -44,7 +44,7 @@ from . import environment
DEPENDENCIES = { DEPENDENCIES = {
("replication", '0.1.9'), ("replication", '0.1.10'),
} }

View File

@ -576,9 +576,13 @@ class SessionApply(bpy.types.Operator):
def execute(self, context): def execute(self, context):
logging.debug(f"Running apply on {self.target}") logging.debug(f"Running apply on {self.target}")
session.apply(self.target, try:
force=True, session.apply(self.target,
force_dependencies=self.reset_dependencies) force=True,
force_dependencies=self.reset_dependencies)
except Exception as e:
self.report({'ERROR'}, repr(e))
return {"CANCELED"}
return {"FINISHED"} return {"FINISHED"}
@ -596,11 +600,13 @@ class SessionCommit(bpy.types.Operator):
return True return True
def execute(self, context): def execute(self, context):
# session.get(uuid=target).diff() try:
session.commit(uuid=self.target) session.commit(uuid=self.target)
session.push(self.target) session.push(self.target)
return {"FINISHED"} return {"FINISHED"}
except Exception as e:
self.report({'ERROR'}, repr(e))
return {"CANCELED"}
class ApplyArmatureOperator(bpy.types.Operator): class ApplyArmatureOperator(bpy.types.Operator):
"""Operator which runs its self from a timer""" """Operator which runs its self from a timer"""