Patch bash history import regression (#970)
* At least patch this on the server side so we don't loop forever * Postgres doesn't support <microsecond precision Use millis - almost everything should support them and they are still faster than a human can reasonably spam a button.
This commit is contained in:
parent
4a9a626e17
commit
bf7432f392
2 changed files with 9 additions and 1 deletions
|
@ -62,7 +62,7 @@ impl Importer for Bash {
|
||||||
// this increment is deliberately very small to prevent particularly fast fingers
|
// this increment is deliberately very small to prevent particularly fast fingers
|
||||||
// causing ordering issues; it also helps in handling the "here document" syntax,
|
// causing ordering issues; it also helps in handling the "here document" syntax,
|
||||||
// where several lines are recorded in succession without individual timestamps
|
// where several lines are recorded in succession without individual timestamps
|
||||||
let timestamp_increment = Duration::nanoseconds(1);
|
let timestamp_increment = Duration::milliseconds(1);
|
||||||
|
|
||||||
// make sure there is a minimum amount of time before the first known timestamp
|
// make sure there is a minimum amount of time before the first known timestamp
|
||||||
// to fit all commands, given the default increment
|
// to fit all commands, given the default increment
|
||||||
|
|
|
@ -53,6 +53,14 @@ pub async fn list<DB: Database>(
|
||||||
)
|
)
|
||||||
.await;
|
.await;
|
||||||
|
|
||||||
|
if req.sync_ts.timestamp_nanos() < 0 || req.history_ts.timestamp_nanos() < 0 {
|
||||||
|
error!("client asked for history from < epoch 0");
|
||||||
|
return Err(
|
||||||
|
ErrorResponse::reply("asked for history from before epoch 0")
|
||||||
|
.with_status(StatusCode::BAD_REQUEST),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
if let Err(e) = history {
|
if let Err(e) = history {
|
||||||
error!("failed to load history: {}", e);
|
error!("failed to load history: {}", e);
|
||||||
return Err(ErrorResponse::reply("failed to load history")
|
return Err(ErrorResponse::reply("failed to load history")
|
||||||
|
|
Loading…
Reference in a new issue