mirror of
https://github.com/lollipopkit/flutter_server_box.git
synced 2025-12-17 23:34:24 +01:00
fix: constantly write script by sftp
This commit is contained in:
@@ -10,7 +10,7 @@ class Server implements TagPickable {
|
||||
SSHClient? client;
|
||||
ServerState state;
|
||||
|
||||
/// Whether is generating client.
|
||||
/// Whether is generating client.
|
||||
/// Use this to avoid reconnecting if last connect try not finished.
|
||||
bool isGenerating = false;
|
||||
|
||||
|
||||
@@ -78,14 +78,12 @@ class SftpReqStatus {
|
||||
case int:
|
||||
size = event;
|
||||
break;
|
||||
case Exception:
|
||||
error = event;
|
||||
break;
|
||||
case Duration:
|
||||
spentTime = event;
|
||||
break;
|
||||
default:
|
||||
error = Exception('unknown event: $event');
|
||||
error = Exception('sftp worker event: $event');
|
||||
dispose();
|
||||
}
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
@@ -267,7 +267,7 @@ class ServerProvider extends ChangeNotifier {
|
||||
|
||||
final time1 = DateTime.now();
|
||||
|
||||
try {
|
||||
try {
|
||||
if (s.isGenerating) return;
|
||||
s.isGenerating = true;
|
||||
s.client = await genClient(
|
||||
@@ -323,6 +323,7 @@ class ServerProvider extends ChangeNotifier {
|
||||
s.status.failedInfo = e.toString();
|
||||
_setServerState(s, ServerState.failed);
|
||||
Loggers.app.warning('Write script to ${spi.name} failed', e);
|
||||
return;
|
||||
} finally {
|
||||
await file.delete();
|
||||
}
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
|
||||
class BuildData {
|
||||
static const String name = "ServerBox";
|
||||
static const int build = 607;
|
||||
static const String engine = "3.13.7";
|
||||
static const String buildAt = "2023-10-22 14:20:27";
|
||||
static const int modifications = 4;
|
||||
static const int build = 611;
|
||||
static const String engine = "3.13.8";
|
||||
static const String buildAt = "2023-10-27 20:42:26";
|
||||
static const int modifications = 7;
|
||||
static const int script = 22;
|
||||
}
|
||||
|
||||
@@ -4,4 +4,4 @@ class RebuildNodes {
|
||||
const RebuildNodes._();
|
||||
|
||||
static final app = RebuildNode();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user