Compare commits

...

2 Commits

Author SHA1 Message Date
b2c54ae8c0 ci: Add Woodpecker CI
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
2023-01-14 15:00:55 +01:00
b16c9f4b30 docs: Add more doc strings 2023-01-14 15:00:02 +01:00
2 changed files with 40 additions and 7 deletions

28
.woodpecker.yml Normal file
View File

@ -0,0 +1,28 @@
pipeline:
# Check moxxmpp
moxxmpp-lint:
image: dart:2.18.1
commands:
- cd packages/moxxmpp
- dart pub get
- dart analyze --fatal-infos --fatal-warnings
moxxmpp-test:
image: dart:2.18.1
commands:
- cd packages/moxxmpp
- dart pub get
- dart test
# Check moxxmpp_socket_tcp
moxxmpp_socket_tcp-lint:
image: dart:2.18.1
commands:
- cd packages/moxxmpp_socket_tcp
- dart pub get
- dart analyze --fatal-infos --fatal-warnings
# moxxmpp-test:
# image: dart:2.18.1
# commands:
# - cd packages/moxxmpp
# - dart pub get
# - dart test

View File

@ -84,16 +84,21 @@ abstract class ReconnectionPolicy {
/// A simple reconnection strategy: Make the reconnection delays exponentially longer
/// for every failed attempt.
/// NOTE: This ReconnectionPolicy may be broken
class ExponentialBackoffReconnectionPolicy extends ReconnectionPolicy {
ExponentialBackoffReconnectionPolicy(this._maxBackoffTime) : super();
ExponentialBackoffReconnectionPolicy(this._maxBackoffTime)
: _counter = 0,
_log = Logger('ExponentialBackoffReconnectionPolicy'),
super();
/// The maximum time in seconds that a backoff step should be.
final int _maxBackoffTime;
int _counter;
/// Amount of consecutive failed reconnections.
int _counter = 0;
/// Backoff timer.
Timer? _timer;
final Logger _log;
/// Logger.
final Logger _log = Logger('ExponentialBackoffReconnectionPolicy');
/// Called when the backoff expired
Future<void> _onTimerElapsed() async {
@ -141,7 +146,7 @@ class ExponentialBackoffReconnectionPolicy extends ReconnectionPolicy {
}
}
/// A stub reconnection policy for tests
/// A stub reconnection policy for tests.
@visibleForTesting
class TestingReconnectionPolicy extends ReconnectionPolicy {
TestingReconnectionPolicy() : super();