Fares 10 ay önce
ebeveyn
işleme
cdc8577811
2 değiştirilmiş dosya ile 13 ekleme ve 13 silme
  1. 11 11
      lib/models/data.dart
  2. 2 2
      tp5/shelf/docker-compose.yml

+ 11 - 11
lib/models/data.dart

@@ -1267,7 +1267,7 @@ processCsvData(File tempfile, SupabaseClient supabase) async {
       final scopeInNew = mapsToInsert
           .fold(<String>{}, (t, e) => t..add(e[scopeName] ?? "")).toList();
 
-      print("Loading old data scope: ${scopeInNew.length}");
+      // print("Loading old data scope: ${scopeInNew.length}");
       List<Map<String, dynamic>> old = [];
       for (var e in splitList(scopeInNew, headerToNb(scopeInNew))) {
         final res = await supabase
@@ -1276,7 +1276,7 @@ processCsvData(File tempfile, SupabaseClient supabase) async {
             .inFilter(scopeName, e)
             .limit(100000);
         old.addAll(res);
-        print("Loaded old data scope: ${e.length}");
+        // print("Loaded old data scope: ${e.length}");
       }
 
       // Replace with your actual table name
@@ -1286,7 +1286,7 @@ processCsvData(File tempfile, SupabaseClient supabase) async {
 
       List<int> indexToRemove = [];
       List<int> indexToMaintain = [];
-      print("Deleting old data scope: ${mapsToInsert.length}");
+      // print("Deleting old data scope: ${mapsToInsert.length}");
       for (int i = 0; i < oldComparable.length; i++) {
         final item = oldComparable[i];
         final index = findIndex(mapsToInsert, item);
@@ -1298,11 +1298,11 @@ processCsvData(File tempfile, SupabaseClient supabase) async {
         }
       }
 
-      print(
-          " indexToRemove: ${indexToRemove.length} , indexToMaintain: ${indexToMaintain.length}");
-      print("delete from db");
+      // print(
+      //     " indexToRemove: ${indexToRemove.length} , indexToMaintain: ${indexToMaintain.length}");
+      // print("delete from db");
 
-      print("delete from db ${indexToRemove.length}");
+      // print("delete from db ${indexToRemove.length}");
 
       for (var e in splitList(indexToRemove.map((e) => old[e]['id']).toList(),
           headerToNb(indexToRemove.map((e) => old[e]['id']).toList()))) {
@@ -1310,7 +1310,7 @@ processCsvData(File tempfile, SupabaseClient supabase) async {
             .from(tables[data.filename]!) // Replace with your actual table name
             .delete()
             .inFilter('id', e);
-        print("Deleted old data scope: ${e.length}");
+        // print("Deleted old data scope: ${e.length}");
       }
 
       // splitList(indexToRemove.map((e) => old[e]['id']).toList(), 200).forEach(
@@ -1319,7 +1319,7 @@ processCsvData(File tempfile, SupabaseClient supabase) async {
       //             tables[data.filename]!) // Replace with your actual table name
       //         .delete()
       //         .inFilter('id', e));
-      print("insert in db");
+      // print("insert in db");
 
       await supabase
           .from(tables[data.filename]!) // Replace with your actual table name
@@ -1334,7 +1334,7 @@ processCsvData(File tempfile, SupabaseClient supabase) async {
       // splitList(mapsToInsert, 200).forEach((e) async => await supabase
       //     .from(tables[data.filename]!) // Replace with your actual table name
       //     .insert(e));
-      print("end");
+      // print("end");
 
       // print(createListOfMaps(headers[data.filename] ?? [], csv2list(data.data)));
     } else {
@@ -1400,6 +1400,6 @@ int headerToNb(List list) {
   final length1 = (list.toString().length / list.length).ceil() * 8;
   final lengthurl = 200 * 8;
   final res = ((maxheader - lengthurl) / length1).floor();
-  print("header2nb: $res");
+  //print("header2nb: $res");
   return res;
 }

+ 2 - 2
tp5/shelf/docker-compose.yml

@@ -1,12 +1,12 @@
 #version: '3.8'
 
 services:
-  dart_server:
+  tp5-shelf:
     image: dart:latest
     volumes:
       - ./app:/app
     working_dir: /app
-    #command: dart run bin/server.dart
+    command: sh -c "dart pub get && dart run bin/server.dart"
     #ports:
     #  - "8082:8080"