-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
bfe22fa
commit b0442c6
Showing
3 changed files
with
16 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
# @Author: chunyang.xu | ||
# @Email: [email protected] | ||
# @Date: 2020-06-10 14:40:50 | ||
# @Last Modified time: 2021-11-16 18:42:55 | ||
# @Last Modified time: 2021-11-20 10:22:21 | ||
# @github: https://github.com/longfengpili | ||
|
||
# !/usr/bin/env python3 | ||
|
@@ -114,18 +114,22 @@ def __init__(self, host, user, password, database, port=3306, charset="utf8", sa | |
|
||
def __new__(cls, *args, **kwargs): | ||
if not hasattr(MysqlDB, '_instance'): | ||
mysqllogger.info(MysqlDB._instance_lock) | ||
with MysqlDB._instance_lock: | ||
mysqllogger.info(MysqlDB._instance_lock) | ||
if not hasattr(MysqlDB, '_instance'): | ||
MysqlDB._instance = super().__new__(cls) | ||
|
||
return MysqlDB._instance | ||
|
||
@classmethod | ||
def get_instance(cls, *args, **kwargs): | ||
mysqllogger.info('1') | ||
if not hasattr(MysqlDB, '_instance'): | ||
mysqllogger.info(MysqlDB._instance_lock) | ||
with MysqlDB._instance_lock: | ||
if not hasattr(MysqlDB, '_instance'): | ||
MysqlDB._instance = MysqlDB(*args, **kwargs) | ||
MysqlDB._instance = super().__new__(cls) | ||
|
||
return MysqlDB._instance | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
# @Author: chunyang.xu | ||
# @Email: [email protected] | ||
# @Date: 2020-06-09 16:46:54 | ||
# @Last Modified time: 2021-11-19 14:57:01 | ||
# @Last Modified time: 2021-11-20 10:22:31 | ||
# @github: https://github.com/longfengpili | ||
|
||
# !/usr/bin/env python3 | ||
|
@@ -12,7 +12,7 @@ | |
import shutil | ||
import setuptools | ||
|
||
VERSION = '0.0.78' | ||
VERSION = '0.0.79' | ||
PROJECT_NAME = 'pydbapi' | ||
|
||
with open('README.md', 'r', encoding='utf-8') as f: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters