Fix sorting of RSS feed entries so that sorting is by time stamp, not
RFS 2822 formatted date.
Bug report: "On the main RSS the entires are limited to 10, to select
the top 10 it is first sorted by the pub_date key
items.sort_by_key(|item| item.pub_date().map(|s| s.to_string()));.
However this date is formated with rfc 2822 so it's starting with the
day of the week "mon/tue/..." resulting in the sort making no sense,
when it should be sorting by latest first."
Found-by: Sean Borg
Signed-off-by: Lars Wirzenius <liw@liw.fi>
Add a function to `src/cob.rs` to announce changes to other nodes.
This is a separate commit as it's the most risky one so I want to make
it easy to revert.
Signed-off-by: Lars Wirzenius <liw@liw.fi>
This makes it easier to specify several adapters, with varying
configurations, by not having to put the configuration for each
specification in a separate file.
Signed-off-by: Lars Wirzenius <liw@liw.fi>
Oops. Brown paper bag moment.
This undoes the type mangling to ensure the field value is never zero,
in favor of doing run time logic. That should be done with types some
day, but today I need to get running.
Signed-off-by: Lars Wirzenius <liw@liw.fi>
I didn't like having asserts, and didn't want debug_asserts. With
plain asserts, the program would have panicked. With debug_asserts, the
program would have silently overwritten the item in the queue.
Instead, change the method to return whether it was able to set, and
have the caller cope with not being able to set. The caller needs to
be able handle that (and was already doing so).
Found-by: Fintan
Signed-off-by: Lars Wirzenius <liw@liw.fi>
Feed child process stdin via a temporary file. This is simpler than
opening a pipe and spawning a thread that feeds the pipe, when it's
not full.
Capture child stderr into a buffer without trying to let the
caller (another thread) process it line by line. We don't seem to have
use for that, and this simplifies things a fair bit.
Simplify the capture of child stdout to use a simpler thread and data
structure, compared to the previous multi-thread setup. Splitting
stdout into lines is now done by the thread that consumes the lines,
making the code that captures it simpler.
Also update the timeout subcommand to work with the changes. Other
callers of this code aren't yet updated.
Signed-off-by: Lars Wirzenius <liw@liw.fi>
This will be useful for inter-thread synchronization in situations
where the producer thread should not produce anything until at least
one consumer is ready for it.
Signed-off-by: Lars Wirzenius <liw@liw.fi>
This doesn't yet affect anything, but it's a step towards implementing
concurrent adapters. The default is 1, which will be no change from
previous behavior, once I add support.
Signed-off-by: Lars Wirzenius <liw@liw.fi>
Make TagName into a new type (struct), instead of a type alias for
RefString. This provide stronger type safety, for the cost of a little
more implementation work. For the needs of the CI broker, that's two
methods and two trait impls.
Signed-off-by: Lars Wirzenius <liw@liw.fi>
We need to parse the run info in the database as JSON to get at the
adapter run info. This fails if the run info can't be parsed. That can
happen if the database has run info from a development version. Change
`cibtool run remove` so that it takes only broker run ids by default
so that we can delete using those even if the run info is broken.
Allow removing by adapter run id with the `--adapter` option.
Signed-off-by: Lars Wirzenius <liw@liw.fi>
If the run info can't be parsed as JSON, loading it will fail. Change
`cibtool run list` so that it only lists the run ids by default.
Signed-off-by: Lars Wirzenius <liw@liw.fi>