gcdsss 最近的时间轴更新
gcdsss

gcdsss

V2EX 第 648152 号会员,加入于 2023-09-12 15:22:53 +08:00
今日活跃度排名 28584
gcdsss 最近回复了
8 天前
回复了 mythace 创建的主题 职场话题 太抽象了,绷不住了
经典
17 天前
回复了 notapple 创建的主题 计算机 组装 AMD 主机,求推荐 2w 以内的配置单
@tog 差不多 2w , 现在配肯定便宜点
17 天前
回复了 notapple 创建的主题 计算机 组装 AMD 主机,求推荐 2w 以内的配置单
去年 10 月份配的 9950x+4080s 主机
处理器 : AMD Ryzen 9 9950X 核心数 16 线程数 32 工艺 4 nm
显卡 : IGame NVIDIA GeForce RTX 4080 SUPER
主板 : ROG STRIX X870-A GAMING WIFI ASUSTeK 芯片组 AMD
硬盘 : 海力士 p41 2T
内存 : G.Skill DDR5-6000 (3000 MHz) 24GBG.Skill DDR5-6000 (3000 MHz) 24GB 容量 48 GB 通道 2 频率 5600 MHz 时序 46-45-45-901TG.Skill DDR5-6000 (3000 MHz) 24GBG.Skill DDR5-6000 (3000 MHz) 24GB
电源 : ROG 白金雷鹰氮化镓 1000w
散热 : 瓦尔基里 gl360 水冷
机箱 : 瓦尔基里 vk03 海景房
刚从那回来,注意地铁交通,跟着谷歌地图去看, 西瓜卡覆盖城市地铁,新干线快速线去 klook 上买
22 天前
回复了 fine886 创建的主题 职场话题 劳动仲裁后续
打赢不难,执行难
23 天前
回复了 lanweizhujiao 创建的主题 游戏 有没有巨好玩的游戏推荐
塞尔达旷野, 近几年唯一治好了我电子阳痿
我踩过坑,解决方法,写一个多线程兼容的 handler 去处理

`
class MultiCompatibleTimedRotatingFileHandler(TimedRotatingFileHandler):
def doRollover(self):
if self.stream:
self.stream.close()
self.stream = None
# get the time that this sequence started at and make it a TimeTuple
currentTime = int(time.time())
dstNow = time.localtime(currentTime)[-1]
t = self.rolloverAt - self.interval
if self.utc:
timeTuple = time.gmtime(t)
else:
timeTuple = time.localtime(t)
dstThen = timeTuple[-1]
if dstNow != dstThen:
if dstNow:
addend = 3600
else:
addend = -3600
timeTuple = time.localtime(t + addend)
dfn = self.baseFilename + "." + time.strftime(self.suffix, timeTuple)
# 兼容多进程并发 LOG_ROTATE
if not os.path.exists(dfn):
f = open(self.baseFilename, "a")
fcntl.lockf(f.fileno(), fcntl.LOCK_EX)
if not os.path.exists(dfn):
os.rename(self.baseFilename, dfn) # 释放锁 释放老 log 句柄
f.close()
if self.backupCount > 0:
for s in self.getFilesToDelete():
os.remove(s)
if not self.delay:
self.stream = self._open()
newRolloverAt = self.computeRollover(currentTime)
while newRolloverAt <= currentTime:
newRolloverAt = newRolloverAt + self.interval
# If DST changes and midnight or weekly rollover, adjust for this.
if (self.when == "MIDNIGHT" or self.when.startswith("W")) and not self.utc:
dstAtRollover = time.localtime(newRolloverAt)[-1]
if dstNow != dstAtRollover:
if (
not dstNow
): # DST kicks in before next rollover, so we need to deduct an hour
addend = -3600
else: # DST bows out before next rollover, so we need to add an hour
addend = 3600
newRolloverAt += addend
self.rolloverAt = newRolloverAt
`
关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   1032 人在线   最高记录 6679   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 12ms · UTC 22:33 · PVG 06:33 · LAX 15:33 · JFK 18:33
Developed with CodeLauncher
♥ Do have faith in what you're doing.