Added support for custom DB Port
This commit is contained in:
parent
13030af3ff
commit
f7c6161027
@ -12,7 +12,7 @@ class DB_Mysql():
|
|||||||
|
|
||||||
required_settings = ['PASSWORD_SALT', 'DB_MYSQL_HOST',
|
required_settings = ['PASSWORD_SALT', 'DB_MYSQL_HOST',
|
||||||
'DB_MYSQL_USER', 'DB_MYSQL_PASS',
|
'DB_MYSQL_USER', 'DB_MYSQL_PASS',
|
||||||
'DB_MYSQL_DBNAME']
|
'DB_MYSQL_DBNAME', 'DB_MYSQL_PORT']
|
||||||
|
|
||||||
for setting_name in required_settings:
|
for setting_name in required_settings:
|
||||||
if not hasattr(settings, setting_name):
|
if not hasattr(settings, setting_name):
|
||||||
@ -26,7 +26,8 @@ class DB_Mysql():
|
|||||||
getattr(settings, 'DB_MYSQL_HOST'),
|
getattr(settings, 'DB_MYSQL_HOST'),
|
||||||
getattr(settings, 'DB_MYSQL_USER'),
|
getattr(settings, 'DB_MYSQL_USER'),
|
||||||
getattr(settings, 'DB_MYSQL_PASS'),
|
getattr(settings, 'DB_MYSQL_PASS'),
|
||||||
getattr(settings, 'DB_MYSQL_DBNAME')
|
getattr(settings, 'DB_MYSQL_DBNAME'),
|
||||||
|
getattr(settings, 'DB_MYSQL_PORT')
|
||||||
)
|
)
|
||||||
self.dbc = self.dbh.cursor()
|
self.dbc = self.dbh.cursor()
|
||||||
self.dbh.autocommit(True)
|
self.dbh.autocommit(True)
|
||||||
@ -69,7 +70,7 @@ class DB_Mysql():
|
|||||||
checkin_times = {}
|
checkin_times = {}
|
||||||
total_shares = 0
|
total_shares = 0
|
||||||
best_diff = 0
|
best_diff = 0
|
||||||
log.debug(data)
|
log.debug(data)
|
||||||
|
|
||||||
for k, v in enumerate(data):
|
for k, v in enumerate(data):
|
||||||
# for database compatibility we are converting our_worker to Y/N format
|
# for database compatibility we are converting our_worker to Y/N format
|
||||||
@ -95,7 +96,7 @@ class DB_Mysql():
|
|||||||
"lres": v[5],
|
"lres": v[5],
|
||||||
"reason": v[9],
|
"reason": v[9],
|
||||||
"solution": v[2],
|
"solution": v[2],
|
||||||
"difficulty": v[3]
|
"difficulty": v[3]
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -347,4 +348,3 @@ class DB_Mysql():
|
|||||||
|
|
||||||
if data[0] <= 0:
|
if data[0] <= 0:
|
||||||
raise Exception("There is no shares table. Have you imported the MPOS schema?")
|
raise Exception("There is no shares table. Have you imported the MPOS schema?")
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user