Skip to content

Commit

Permalink
fix: missing import
Browse files Browse the repository at this point in the history
  • Loading branch information
germa89 committed Jul 31, 2024
1 parent 801da91 commit d63dcce
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/ansys/mapdl/core/database/database.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
from functools import wraps
import os
import time
from typing import Optional
from warnings import warn
import weakref

Expand Down Expand Up @@ -157,7 +158,7 @@ def _start(self, port: Optional[int] = None) -> int:
# database server must be run from the "BEGIN" level
self._mapdl._log.debug("Starting MAPDL server")
self._mapdl._cache_routine()
with self._mapdl.run_as_routine("finish"):
with self._mapdl.run_as_routine("Begin level"):
self._mapdl.run(f"/DBS,SERVER,START,{port}")

if not port:
Expand Down Expand Up @@ -283,13 +284,13 @@ def start(self, port: Optional[int] = None, timeout: int = 10):

if not self._state._matured: # pragma: no cover
raise MapdlConnectionError(
"Unable to establish connection to MAPDL database server"
f"Unable to establish connection to MAPDL database server {self._channel_str}"
)
self._mapdl._log.debug("Established connection to MAPDL database server")

def _stop(self):
"""Stop the MAPDL database service."""
with self._mapdl.run_as_routine("finish"):
with self._mapdl.run_as_routine("Begin level"):
return self._mapdl.run("/DBS,SERVER,STOP")

def stop(self):
Expand Down Expand Up @@ -326,7 +327,7 @@ def _status(self):
DB Server is NOT currently running ..
"""
# Need to use the health check here
with self._mapdl.run_as_routine("finish"):
with self._mapdl.run_as_routine("Begin level"):
return self._mapdl.run("/DBS,SERVER,STATUS")

def load(self, fname, progress_bar=False):
Expand Down

0 comments on commit d63dcce

Please sign in to comment.