Commit 36e0bff4 authored by Mustafa Gezen's avatar Mustafa Gezen
Browse files

Use `logger.error` for exception logging

parent 85589fe8
......@@ -26,7 +26,6 @@ from typing import Tuple, Optional, List
import aio_pika
from distrobuild.settings import settings
from distrobuild_scheduler import import_package
# singleton
connection: Optional[aio_pika.RobustConnection] = None
......
......@@ -18,8 +18,6 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
import datetime
from typing import Optional
import koji
......@@ -30,6 +28,7 @@ from distrobuild.mbs import MBSConflictException
from distrobuild.models import Build, BuildStatus, Package
from distrobuild.session import koji_session, mbs_client
from distrobuild.settings import settings
from distrobuild_scheduler import logger
from distrobuild_scheduler.utils import gitlabify
......@@ -79,7 +78,7 @@ async def task(package_id: int, build_id: int, token: Optional[str]):
try:
await do(package, build, token)
except Exception as e:
print(e)
logger.error(e)
build.status = BuildStatus.FAILED
package.last_build = None
finally:
......
......@@ -29,6 +29,7 @@ from distrobuild.models import ImportStatus, Package, Import, ImportCommit, Repo
from distrobuild.session import koji_session, gl
from distrobuild.settings import settings
from distrobuild import srpmproc
from distrobuild_scheduler import logger
from distrobuild_scheduler.utils import gitlabify
......@@ -64,7 +65,7 @@ async def task(package_id: int, import_id: int, dependents: List[Tuple[int, int]
await do(package, package_import)
except Exception as e:
print(e)
logger.error(e)
package_import.status = ImportStatus.FAILED
package.last_import = None
else:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment