mirror of
https://github.com/euzu/tuliprox.git
synced 2026-10-05 23:42:47 +02:00
Feature/provider config (#570)
New Features - Automatic provider failover & rotation across multiple provider URLs with a provider:// scheme and capped retries - Configurable failover redirect patterns to influence retry/failover behavior UI - New interface to view and edit failover redirect patterns in reverse proxy configuration - Expanded docs covering Provider Failover & Rotation and enriched messaging templating Reliability - Improved URL resolution, error reporting and logging for more robust provider handling
This commit is contained in:
@@ -14,8 +14,15 @@ macro_rules! get_errors_notify_message {
|
||||
.map(|err| err.message.as_str())
|
||||
.collect::<Vec<&str>>()
|
||||
.join("\r\n");
|
||||
if $size > 0 && text.len() > std::cmp::max($size - 3, 3) {
|
||||
Some(format!("{}...", text.get(0..$size).unwrap()))
|
||||
|
||||
let max_size = $size;
|
||||
// Check if we actually need to truncate
|
||||
if max_size > 0 && text.chars().count() > max_size {
|
||||
// Safely take 'max_size' characters and add ellipsis
|
||||
let truncated: String = text.chars().take(max_size).collect();
|
||||
Some(format!("{}...", truncated))
|
||||
} else if text.is_empty() {
|
||||
None
|
||||
} else {
|
||||
Some(text)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user