Skip to content

Commit

Permalink
v0.2.1-rc3 - release
Browse files Browse the repository at this point in the history
  • Loading branch information
daveajones committed Nov 29, 2022
1 parent 43eedfc commit d201a80
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 7 deletions.
2 changes: 1 addition & 1 deletion docker/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ services:
ipv4_address: 192.168.69.68

hive-writer:
image: docker.io/podcastindexorg/podping-hivewriter:pr-67
image: docker.io/podcastindexorg/podping-hivewriter:develop
command: ["server"]
init: true
restart: unless-stopped
Expand Down
3 changes: 2 additions & 1 deletion podping/dbif/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,8 @@ pub fn reset_pings_in_flight() -> Result<bool, Box<dyn Error>> {
SET inflight = 0, \
createdon = STRFTIME('%s') \
WHERE inflight = 1 \
AND createdon < (STRFTIME('%s') - 180)",
AND createdon < (STRFTIME('%s') - 180)\
LIMIT 25",
params![])
{
Ok(_) => {
Expand Down
16 changes: 11 additions & 5 deletions podping/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -167,11 +167,6 @@ async fn main() {
Err(_) => eprintln!("SystemTime before UNIX EPOCH!"),
}

//Reset old inflight pings that may have never been sent
if dbif::reset_pings_in_flight().is_err() {
eprintln!(" Failed to reset old in-flight pings.");
}

//We always want to try and receive any waiting socket messages before moving on to sending
receive_messages(&requester);

Expand Down Expand Up @@ -301,9 +296,20 @@ async fn main() {
}
}

//Only sleep to avoid a hard loop in the case that there aren't enough
//recv() timeouts happening to simulate decent slowness
if sent < 5 {
thread::sleep(Duration::from_millis(LOOP_TIMER_MILLISECONDS));
}

//Reset old inflight pings that may have never been sent, but only do this
//when things are not super busy since that is a sign that the writer may
//be full up and we need to allow more time
if sent < 25 {
if dbif::reset_pings_in_flight().is_err() {
eprintln!(" Failed to reset old in-flight pings.");
}
}
}
});

Expand Down

0 comments on commit d201a80

Please sign in to comment.