Commit fe8c3122 authored by 张永's avatar 张永

添加日志

parent 6e60680a
...@@ -6,7 +6,7 @@ from django.conf import settings ...@@ -6,7 +6,7 @@ from django.conf import settings
from gm_upload.utils.qiniu_tool import QiniuTool from gm_upload.utils.qiniu_tool import QiniuTool
from qiniu import put_file from qiniu import put_file
from utils.logger import log_error from utils.logger import log_error, info_logger
class QiniuFileTool(QiniuTool): class QiniuFileTool(QiniuTool):
...@@ -73,7 +73,7 @@ class ChannelPackage(object): ...@@ -73,7 +73,7 @@ class ChannelPackage(object):
os.remove(self.apk) os.remove(self.apk)
os.remove(self.channel_prefix + '_' + channel_name + '.apk') os.remove(self.channel_prefix + '_' + channel_name + '.apk')
def upload_apk(self, channel_name): def upload_apk(self, channel_name):# zhuoyi
chn_apk_path = self.build_channel_apk(channel_name) chn_apk_path = self.build_channel_apk(channel_name)
apk_uri = self.apk_key(channel_name, self.version) apk_uri = self.apk_key(channel_name, self.version)
QiniuTool.delete(apk_uri, settings.APK_SCOPE) QiniuTool.delete(apk_uri, settings.APK_SCOPE)
...@@ -103,10 +103,17 @@ class ChannelPackage(object): ...@@ -103,10 +103,17 @@ class ChannelPackage(object):
apk_scope = settings.APK_SCOPE apk_scope = settings.APK_SCOPE
version_key = cls.apk_key(channel, version) version_key = cls.apk_key(channel, version)
current_key = cls.apk_key(channel, settings.APK_RELEASE_DIR) current_key = cls.apk_key(channel, settings.APK_RELEASE_DIR)
print('current_key:', current_key)
ret, info = QiniuTool.bucket.stat(apk_scope, current_key) ret, info = QiniuTool.bucket.stat(apk_scope, current_key)
info_logger.debug(
{
'channel': channel,
'version': version,
'version_key': version_key,
'current_key': current_key,
'ret': ret
}
)
if ret: if ret:
print('delete')
QiniuTool.delete(current_key, apk_scope) QiniuTool.delete(current_key, apk_scope)
QiniuTool.copy(version_key, current_key, apk_scope, apk_scope) QiniuTool.copy(version_key, current_key, apk_scope, apk_scope)
if need_refresh: if need_refresh:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment