Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

donnot set auto_now_add for ArchiveLog.start_time #1113

Merged
merged 1 commit into from
Jun 12, 2021

Conversation

swords1999
Copy link
Contributor

@swords1999 swords1999 commented Jun 10, 2021

解决bug, fix #853

@LeoQuote
Copy link
Collaborator

没啥问题, 这个值在这里赋了

Archery/sql/archiver.py

Lines 375 to 395 in f1d9e6c

ArchiveConfig(id=archive_id, last_archive_time=t.end).save(update_fields=['last_archive_time'])
# 替换密码信息后保存
ArchiveLog.objects.create(
archive=archive_info,
cmd=cmd_args.replace(s_ins.password, '***').replace(
d_ins.password, '***') if mode == 'dest' else cmd_args.replace(s_ins.password, '***'),
condition=condition,
mode=mode,
no_delete=no_delete,
sleep=sleep,
select_cnt=select_cnt,
insert_cnt=insert_cnt,
delete_cnt=delete_cnt,
statistics=statistics,
success=success,
error_info=error_info,
start_time=t.start,
end_time=t.end
)
if not success:
raise Exception(f'{error_info}\n{statistics}')

Copy link
Collaborator

@LeoQuote LeoQuote left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@LeoQuote LeoQuote changed the title Update models.py donnot set auto_now_add for ArchiveLog.start_time Jun 11, 2021
@hhyo hhyo merged commit 18b9590 into hhyo:master Jun 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants