From: vincent@cubedesigners.com Date: Thu, 1 Dec 2022 15:27:00 +0000 (+0000) Subject: wait #5622 @0:20 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=9df29cd630628ab870780c15a5afdc955f409ae1;p=cubeextranet.git wait #5622 @0:20 --- diff --git a/.docker/config/cron/crontab b/.docker/config/cron/crontab index f10bb874d..5113fbc0b 100644 --- a/.docker/config/cron/crontab +++ b/.docker/config/cron/crontab @@ -2,11 +2,11 @@ MAILTO=sysadmin@cubedesigners.com SHELL=/bin/sh PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin -20 * * * * root lynx --dump https://workshop.fluidbook.com/maintenance/cleanDownload >/dev/null 2>/dev/null -0 2 * * * root lynx --dump https://workshop.fluidbook.com/maintenance/deleteOldFilesFromFTP >/dev/null 2>/dev/null -0 5 * * * root lynx --dump https://workshop.fluidbook.com/maintenance/cleanCompiledBooks >/dev/null 2>/dev/null -40 * * * * root lynx --dump https://workshop.fluidbook.com/maintenance/cleanPackages >/dev/null 2>/dev/null -0 1 * * * root lynx --dump https://workshop.fluidbook.com/maintenance/cleanConversionSessions >/dev/null 2>/dev/null -*/5 * * * * root /application/bin/fixpackagerrights >/dev/null 2>/dev/null -35 3 * * * root /application/bin/compresslogs >/dev/null 2>/dev/null -10 * * * * root /application/bin/cleantmp >/dev/null 2>/dev/null +20 * * * * root /usr/bin/lynx --dump https://workshop.fluidbook.com/maintenance/cleanDownload >/dev/null 2>/dev/null +0 2 * * * root /usr/bin/lynx --dump https://workshop.fluidbook.com/maintenance/deleteOldFilesFromFTP >/dev/null 2>/dev/null +0 5 * * * root /usr/bin/lynx --dump https://workshop.fluidbook.com/maintenance/cleanCompiledBooks >/dev/null 2>/dev/null +40 * * * * root /usr/bin/lynx --dump https://workshop.fluidbook.com/maintenance/cleanPackages >/dev/null 2>/dev/null +0 1 * * * root /usr/bin/lynx --dump https://workshop.fluidbook.com/maintenance/cleanConversionSessions >/dev/null 2>/dev/null +*/5 * * * * root /application/bin/fixpackagerrights >/dev/null 2>/dev/null +35 3 * * * root /application/bin/compresslogs >/dev/null 2>/dev/null +10 * * * * root /application/bin/cleantmp >/dev/null 2>/dev/null diff --git a/inc/ws/Controlleur/class.ws.maintenance.php b/inc/ws/Controlleur/class.ws.maintenance.php index 2e154d339..d901fb624 100644 --- a/inc/ws/Controlleur/class.ws.maintenance.php +++ b/inc/ws/Controlleur/class.ws.maintenance.php @@ -143,13 +143,15 @@ class wsMaintenance public static function cleanPackages() { + echo '
';
         $limit = TIME - (2 * 3600); // 2 heures avant maintenant*
         //
         $dirs = array(
-            WS_FILES . '/packager/'
+            WS_FILES . '/packager/',
+            WS_FILES . '/packager/nwbuild'
         );
-        // Clean downloads
 
+        // Clean downloads
         foreach ($dirs as $dir) {
             if (!file_exists($dir)) {
                 continue;
@@ -157,18 +159,23 @@ class wsMaintenance
             $dr = opendir($dir);
             while ($file = readdir($dr)) {
                 if ($file == '.' || $file == '..') {
+                    echo 'skip '.$file." (dot)\n";
                     continue;
                 }
                 $f = $dir . $file;
-                if ($file == 'download') {
+                if ($file == 'download' || $file=='nwbuild') {
+                    echo 'skip '.$file." (base)\n";
                     continue;
                 }
                 if (!is_dir($f)) {
+                    echo 'skip '.$file." (file)\n";
                     continue;
                 }
                 if (filemtime($f) > $limit) {
+                    echo 'skip '.$file." (time)\n";
                     continue;
                 }
+                echo 'clean '.$file."\n";
                 `rm -rf $f`;
             }
 
@@ -398,15 +405,7 @@ class wsMaintenance
     {
         $dirs = [ROOT . '/cache/download/', WS_FILES . '/packager/download'];
         foreach ($dirs as $dir) {
-            cubeFiles::scanRecursiveDir($dir, $files);
-            $limit = TIME - 7200;
-            if (is_array($files)) {
-                foreach ($files as $f) {
-                    if (filemtime($f) < $limit) {
-                        unlink($f);
-                    }
-                }
-            }
+            echo `find $dir -name '*.*' -mmin +240 -delete -print`;
         }
     }
 
@@ -1477,7 +1476,7 @@ class wsMaintenance
         $portions = array_chunk($allPages, ceil($count / $it));
 
         foreach ($portions as $p) {
-            $url = 'https://workshop.fluidbook.com/maintenance/processPage/' . $book_id . '/' . implode(',', $p) . '/' . ($force ? '1' : '0') . '?PHPSESSID=' . session_id();
+            $url = 'https://workshop.fluidbook.com/maintenance/processPage/' . $book_id . '/' . implode(',', $p) . '/' . ($force ? '1' : '0');
             echo $url . "\n";
             self::timeoutRequest($url, 1);
         }
diff --git a/inc/ws/Metier/class.ws.book.php b/inc/ws/Metier/class.ws.book.php
index cf69cdad8..47bb27bde 100644
--- a/inc/ws/Metier/class.ws.book.php
+++ b/inc/ws/Metier/class.ws.book.php
@@ -130,6 +130,6 @@ class wsBook extends cubeMetier
     public static function precompileImages($book_id)
     {
         // Begin to generate files async
-        wsMaintenance::timeoutRequest('https://workshop.fluidbook.com/maintenance/processBookPages/' . $book_id . '?PHPSESSID=' . session_id(), 1);
+        wsMaintenance::timeoutRequest('https://workshop.fluidbook.com/maintenance/processBookPages/' . $book_id, 1);
     }
 }
\ No newline at end of file
diff --git a/inc/ws/Util/html5/master/class.ws.html5.links.php b/inc/ws/Util/html5/master/class.ws.html5.links.php
index f6273670e..43e9144fa 100644
--- a/inc/ws/Util/html5/master/class.ws.html5.links.php
+++ b/inc/ws/Util/html5/master/class.ws.html5.links.php
@@ -501,7 +501,8 @@ class wsHTML5Link
 
     public function isOutsidePage()
     {
-        if ($this->top > $this->compiler->height) {
+        $height = isset($this->compiler->config->pagesDimensions[$this->page][1]) ?: $this->compiler->height;
+        if ($this->top > $height) {
             return true;
         }
         if ($this->left > $this->compiler->width) {
@@ -1643,7 +1644,7 @@ class webVideoLink extends videoLink
         }
     }
 
-    public static function makeVideoTag($linkDatas, $w=null, $h=null, $compiler = null)
+    public static function makeVideoTag($linkDatas, $w = null, $h = null, $compiler = null)
     {
         if ($linkDatas->video_service == 0) {
             return parent::makeVideoTag($linkDatas, $w, $h, $compiler);
@@ -2893,7 +2894,7 @@ class zoomLink extends normalLink
             // scale factor on the extracted images. It does so by dividing by 72, so we can pass our own scale
             // factor by setting the resolution to 72 * $maxzoom
             'resolution' => round(150 * $maxzoom),
-            'texts'=> $attributes['texts'] ?? true
+            'texts' => $attributes['texts'] ?? true
         ];
 
         // Round all link co-ordinates because there seems to be a problem with the the Workshop link editor