def get_size(self):
""" Return queue file size. """
try:
with open(self.file_path, 'r') as fd:
fcntl.flock(fd, fcntl.LOCK_SH)
size = os.fstat(fd.fileno()).st_size
fcntl.flock(fd, fcntl.LOCK_UN)
return size
except Exception:
return 0
评论列表
文章目录