Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
CloWM S3-Proxy Service
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Admin message
Looking for advice? Join the
Matrix channel for GitLab users in Bielefeld
!
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
Computational Metagenomics
CloWM
CloWM S3-Proxy Service
Commits
6a627d32
Verified
Commit
6a627d32
authored
2 years ago
by
Daniel Göbel
Browse files
Options
Downloads
Patches
Plain Diff
Use the database URI from the settings in alembic
#10
parent
44dc1d27
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
ProxyAPI/alembic/env.py
+2
-12
2 additions, 12 deletions
ProxyAPI/alembic/env.py
ProxyAPI/app/api/miscellaneous_endpoints.py
+1
-1
1 addition, 1 deletion
ProxyAPI/app/api/miscellaneous_endpoints.py
ProxyAPI/app/main.py
+1
-1
1 addition, 1 deletion
ProxyAPI/app/main.py
with
4 additions
and
14 deletions
ProxyAPI/alembic/env.py
+
2
−
12
View file @
6a627d32
import
asyncio
import
os
from
logging.config
import
fileConfig
from
pydantic
import
AnyUrl
from
sqlalchemy
import
engine_from_config
,
pool
from
sqlalchemy.ext.asyncio
import
AsyncEngine
from
alembic
import
context
from
app.core.config
import
settings
from
app.db.base
import
Base
# this is the Alembic Config object, which provides
...
...
@@ -30,16 +29,7 @@ target_metadata = Base.metadata
def
get_url
()
->
str
:
return
str
(
AnyUrl
.
build
(
scheme
=
"
mysql+aiomysql
"
,
password
=
os
.
getenv
(
"
DB_PASSWORD
"
,
""
),
user
=
os
.
getenv
(
"
DB_USER
"
,
""
),
port
=
os
.
getenv
(
"
DB_PORT
"
,
"
3306
"
),
host
=
os
.
getenv
(
"
DB_HOST
"
,
"
localhost
"
),
path
=
f
"
/
{
os
.
getenv
(
'
DB_DATABASE
'
,
''
)
}
"
,
)
)
return
str
(
settings
.
SQLALCHEMY_DATABASE_ASYNC_URI
)
def
run_migrations_offline
():
...
...
This diff is collapsed.
Click to expand it.
ProxyAPI/app/api/miscellaneous_endpints.py
→
ProxyAPI/app/api/miscellaneous_endp
o
ints.py
+
1
−
1
View file @
6a627d32
...
...
@@ -16,7 +16,7 @@ async def health_check(db: AsyncSession = Depends(get_db)) -> dict[str, str]:
except
Exception
:
raise
HTTPException
(
status_code
=
status
.
HTTP_500_INTERNAL_SERVER_ERROR
,
detail
=
"
Connection to database lost
"
)
try
:
httpx
.
get
(
settings
.
OBJECT_GATEWAY_URI
,
timeout
=
5.0
)
httpx
.
get
(
settings
.
OBJECT_GATEWAY_URI
,
timeout
=
3.5
)
except
Exception
:
raise
HTTPException
(
status_code
=
status
.
HTTP_500_INTERNAL_SERVER_ERROR
,
detail
=
"
Connection to RGW lost
"
)
return
{
"
status
"
:
"
OK
"
}
...
...
This diff is collapsed.
Click to expand it.
ProxyAPI/app/main.py
+
1
−
1
View file @
6a627d32
...
...
@@ -5,7 +5,7 @@ from fastapi.middleware.gzip import GZipMiddleware
from
starlette.middleware.sessions
import
SessionMiddleware
from
app.api.api
import
api_router
from
app.api.miscellaneous_endpints
import
miscellaneous_router
from
app.api.miscellaneous_endp
o
ints
import
miscellaneous_router
from
app.core.config
import
settings
description
=
"""
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment