danylokhodus commited on
Commit
977fb40
·
1 Parent(s): f21fc8a

fix: revert to stable SQLite settings and enforce 5MB payload limit to prevent disk I/O errors

Browse files
Files changed (1) hide show
  1. FlowAPI/Program.cs +3 -4
FlowAPI/Program.cs CHANGED
@@ -47,7 +47,7 @@ namespace FlowAPI
47
  // --- SignalR ---
48
  builder.Services.AddSignalR(options =>
49
  {
50
- options.MaximumReceiveMessageSize = 10 * 1024 * 1024; // 10MB
51
  options.EnableDetailedErrors = true;
52
  });
53
 
@@ -136,12 +136,11 @@ namespace FlowAPI
136
 
137
  db.Database.Migrate();
138
 
139
- // Aggressive stability PRAGMAs for Cloud/Docker filesystems (Hugging Face)
140
  using (var command = db.Database.GetDbConnection().CreateCommand())
141
  {
142
  db.Database.OpenConnection();
143
- // journal_mode=MEMORY and locking_mode=EXCLUSIVE bypass most disk-locking issues
144
- command.CommandText = "PRAGMA journal_mode=MEMORY; PRAGMA synchronous=OFF; PRAGMA locking_mode=EXCLUSIVE; PRAGMA temp_store=MEMORY; PRAGMA cache_size=-20000;";
145
  command.ExecuteNonQuery();
146
  }
147
 
 
47
  // --- SignalR ---
48
  builder.Services.AddSignalR(options =>
49
  {
50
+ options.MaximumReceiveMessageSize = 5 * 1024 * 1024; // 5MB limit
51
  options.EnableDetailedErrors = true;
52
  });
53
 
 
136
 
137
  db.Database.Migrate();
138
 
139
+ // Set journal mode to TRUNCATE for stability on Docker/Cloud filesystems
140
  using (var command = db.Database.GetDbConnection().CreateCommand())
141
  {
142
  db.Database.OpenConnection();
143
+ command.CommandText = "PRAGMA journal_mode=TRUNCATE; PRAGMA synchronous=NORMAL; PRAGMA locking_mode=NORMAL; PRAGMA temp_store=MEMORY;";
 
144
  command.ExecuteNonQuery();
145
  }
146