-
Notifications
You must be signed in to change notification settings - Fork 40
Store duration in database #487
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| -- Add down migration script here | ||
| ALTER TABLE build DROP COLUMN duration; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| -- Add up migration script here | ||
| ALTER TABLE build ADD COLUMN duration INTERVAL; | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -269,6 +269,8 @@ async fn maybe_complete_build( | |
| }; | ||
|
|
||
| db.update_build_status(&build, status).await?; | ||
| db.update_build_duration(&build, payload.running_time) | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Let's modify the duration in the
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I was about to add duration in db.update_build_status, but saw this function was used elsewhere which changes only status.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That's fine, it can just be |
||
| .await?; | ||
| if let Some(trigger) = trigger { | ||
| handle_label_trigger(repo, pr_num, trigger).await?; | ||
| } | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| UPDATE build | ||
| SET | ||
| duration = '3h 8m 37s' | ||
| WHERE | ||
| id = 1; | ||
|
|
||
| UPDATE build | ||
| SET | ||
| duration = '3h 11m 36s' | ||
| WHERE | ||
| id = 2; | ||
|
|
||
| UPDATE build | ||
| SET | ||
| duration = '3h 12m 15s' | ||
| WHERE | ||
| id = 3; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Huh, first time I see this (Postgre)SQL data type. Cute.