]> _ Git - cubeextranet.git/commitdiff
wait #5622 @0:20
authorvincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Thu, 1 Dec 2022 15:27:00 +0000 (15:27 +0000)
committervincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Thu, 1 Dec 2022 15:27:00 +0000 (15:27 +0000)
.docker/config/cron/crontab
inc/ws/Controlleur/class.ws.maintenance.php
inc/ws/Metier/class.ws.book.php
inc/ws/Util/html5/master/class.ws.html5.links.php

index f10bb874d1bc0125066c984b4b09c9f0360fb064..5113fbc0bd71bb2770591ef2d40079d7bd1aa933 100644 (file)
@@ -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
index 2e154d33966160521fca7bdffea902eba137e0ce..d901fb62494158b5405fc0f538f78fd1308ee7da 100644 (file)
@@ -143,13 +143,15 @@ class wsMaintenance
 
     public static function cleanPackages()
     {
+        echo '<pre>';
         $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);
         }
index cf69cdad80d06fc5b26a35dc26f97ad987eea8d4..47bb27bde28ae58134d1b9ea02041c22bc1dcd81 100644 (file)
@@ -130,6 +130,6 @@ class wsBook extends cubeMetier
     public static function precompileImages($book_id)\r
     {\r
         // Begin to generate files async\r
-        wsMaintenance::timeoutRequest('https://workshop.fluidbook.com/maintenance/processBookPages/' . $book_id . '?PHPSESSID=' . session_id(), 1);\r
+        wsMaintenance::timeoutRequest('https://workshop.fluidbook.com/maintenance/processBookPages/' . $book_id, 1);\r
     }\r
 }
\ No newline at end of file
index f6273670e10e0a107507820da0949d51e265b8bd..43e9144fa790800576dbddcd046ee8fc0b90fddc 100644 (file)
@@ -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