__init__.py 文件源码

python
阅读 20 收藏 0 点赞 0 评论 0

项目:borgcube 作者: enkore 项目源码 文件源码
def _add_completed_archive(self):
        log.debug('Saving archive metadata to database')
        archive = BorgArchive(self.repository, self._repository_key, self._manifest, self.job.archive_name, cache=self._cache)
        stats = archive.calc_stats(self._cache)
        duration = archive.ts_end - archive.ts
        ao = Archive(
            id=archive.fpr,
            repository=self.job.repository,
            name=archive.name,
            client=self.job.client,
            job=self.job,
            nfiles=stats.nfiles,
            original_size=stats.osize,
            compressed_size=stats.csize,
            deduplicated_size=stats.usize,
            duration=duration,
            timestamp=archive.ts,
            timestamp_end=archive.ts_end,
        )
        self.job.archive = ao
        transaction.get().note('Added completed archive %s for job %s' % (ao.id, self.job.id))
        transaction.commit()
        log.debug('Saved archive metadata')
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号