Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
CSS-Engine-Python-Cusca
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Proyectos-Innovacion-2024
CSS-Engine-Python-Cusca
Commits
c1597525
Commit
c1597525
authored
May 07, 2024
by
Cristian Aguirre
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update action-exclude-records-v1-dask
parent
b0fd6670
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
123 additions
and
92 deletions
+123
-92
Database.py
app/main/engine/database/Database.py
+9
-0
Mysql.py
app/main/engine/database/Mysql.py
+10
-2
conf.yml
conf.yml
+4
-4
match-and-exclude-records-actions_v1.py
scripts/match-and-exclude-records-actions_v1.py
+100
-86
No files found.
app/main/engine/database/Database.py
View file @
c1597525
...
@@ -44,6 +44,15 @@ class Database:
...
@@ -44,6 +44,15 @@ class Database:
except
Exception
as
e
:
except
Exception
as
e
:
self
.
app
.
logger
.
error
(
f
"Error cerrando básica conexión. {e}"
)
self
.
app
.
logger
.
error
(
f
"Error cerrando básica conexión. {e}"
)
def
get_dialect
(
self
)
->
str
:
dialect
=
""
try
:
dialect
=
self
.
factory
.
get_dialect
()
except
Exception
as
e
:
self
.
app
.
logger
.
error
(
f
"Error obteniendo dialect. {e}"
)
finally
:
return
dialect
def
create_engine
(
self
)
->
None
:
def
create_engine
(
self
)
->
None
:
try
:
try
:
if
isinstance
(
self
.
engine
,
type
(
None
)):
if
isinstance
(
self
.
engine
,
type
(
None
)):
...
...
app/main/engine/database/Mysql.py
View file @
c1597525
...
@@ -23,6 +23,7 @@ class Mysql:
...
@@ -23,6 +23,7 @@ class Mysql:
self
.
params
=
params
self
.
params
=
params
self
.
engine
=
None
self
.
engine
=
None
self
.
connection
=
None
self
.
connection
=
None
self
.
dialect
=
None
def
create_spark_connection
(
self
):
def
create_spark_connection
(
self
):
params
=
{}
params
=
{}
...
@@ -46,10 +47,17 @@ class Mysql:
...
@@ -46,10 +47,17 @@ class Mysql:
finally
:
finally
:
return
self
.
connection
return
self
.
connection
def
create_engine
(
self
)
->
None
:
def
get_dialect
(
self
)
->
str
:
try
:
try
:
dialect
=
DatabaseDialectEnum
.
MYSQL
.
value
dialect
=
DatabaseDialectEnum
.
MYSQL
.
value
url
=
f
"{dialect}://{self.user}:{self.password}@{self.host}:{str(self.port)}/{self.database}?charset=utf8mb4"
self
.
dialect
=
f
"{dialect}://{self.user}:{self.password}@{self.host}:{str(self.port)}/{self.database}?charset=utf8mb4"
except
Exception
as
e
:
self
.
app
.
logger
.
error
(
f
"Error obteniendo dialect de Mysql. {e}"
)
return
self
.
dialect
def
create_engine
(
self
)
->
None
:
try
:
url
=
self
.
get_dialect
()
self
.
engine
=
create_engine
(
url
,
pool_recycle
=
3600
,
pool_pre_ping
=
True
,
**
self
.
params
)
self
.
engine
=
create_engine
(
url
,
pool_recycle
=
3600
,
pool_pre_ping
=
True
,
**
self
.
params
)
except
Exception
as
e
:
except
Exception
as
e
:
self
.
app
.
logger
.
error
(
f
"Error creando engine de Mysql. {e}"
)
self
.
app
.
logger
.
error
(
f
"Error creando engine de Mysql. {e}"
)
...
...
conf.yml
View file @
c1597525
...
@@ -23,16 +23,16 @@ app:
...
@@ -23,16 +23,16 @@ app:
timezone
:
'
GMT-5'
timezone
:
'
GMT-5'
time_pattern
:
'
%Y-%m-%d
%H:%M:%S'
time_pattern
:
'
%Y-%m-%d
%H:%M:%S'
logging
:
'
INFO'
logging
:
'
INFO'
max_engine_threads
:
2
# threads (maximum)
max_engine_threads
:
50
# threads (maximum)
# Make the service in a production state
# Make the service in a production state
# Manage connections to the REST Service published. Allow workers to receive the connections.
# Manage connections to the REST Service published. Allow workers to receive the connections.
# https://docs.gunicorn.org/en/stable/
# https://docs.gunicorn.org/en/stable/
gunicorn
:
gunicorn
:
bind
:
'
0.0.0.0:
75
00'
bind
:
'
0.0.0.0:
80
00'
worker_class
:
'
gthread'
worker_class
:
'
gthread'
threads
:
8
threads
:
51
worker_connections
:
5
0
worker_connections
:
5
1
loglevel
:
'
debug'
loglevel
:
'
debug'
accesslog
:
'
-'
accesslog
:
'
-'
capture_output
:
True
capture_output
:
True
\ No newline at end of file
scripts/match-and-exclude-records-actions_v1.py
View file @
c1597525
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment