Skip to content

Commit

Permalink
remove ai code
Browse files Browse the repository at this point in the history
  • Loading branch information
kb1ns committed Dec 14, 2023
1 parent a7b2472 commit 2fe9883
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 19 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# v0.7.0-rc.11
# v0.7.0-rc.12

- online test of migration

Expand Down
34 changes: 16 additions & 18 deletions engine/src/migration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -104,24 +104,22 @@ mod v1_to_v2 {
}

async fn migrate_sequences(pool: &Pool<MySql>, event_id: u64, limit: usize) -> u64 {
let r = futures::executor::block_on(async move {
let sql = format!(
"select f_id,f_cmd,f_status,f_timestamp from t_sequence where f_id > {} limit {}",
event_id, limit
);
sqlx::query(&sql)
.map(|row: sqlx::mysql::MySqlRow| -> (u64, Command, u8) {
let mut cmd: Command = serde_json::from_str(row.get("f_cmd")).unwrap();
cmd.timestamp = Some(
row.get::<sqlx::types::time::OffsetDateTime, &str>("f_timestamp")
.unix_timestamp() as u64,
);
(row.get("f_id"), cmd, row.get("f_status"))
})
.fetch_all(pool)
.await
.unwrap()
});
let sql = format!(
"select f_id,f_cmd,f_status,f_timestamp from t_sequence where f_id > {} limit {}",
event_id, limit
);
let r = sqlx::query(&sql)
.map(|row: sqlx::mysql::MySqlRow| -> (u64, Command, u8) {
let mut cmd: Command = serde_json::from_str(row.get("f_cmd")).unwrap();
cmd.timestamp = Some(
row.get::<sqlx::types::time::OffsetDateTime, &str>("f_timestamp")
.unix_timestamp() as u64,
);
(row.get("f_id"), cmd, row.get("f_status"))
})
.fetch_all(pool)
.await
.unwrap();
let mut cursor = event_id;
for cmd in r {
if cmd.2 != 2 {
Expand Down

0 comments on commit 2fe9883

Please sign in to comment.