Changeset 2510697
- Timestamp:
- 04/07/2021 10:51:40 AM (5 years ago)
- Location:
- officegest/trunk
- Files:
-
- 4 edited
-
officegest.php (modified) (1 diff)
-
readme.txt (modified) (2 diffs)
-
src/Crons.php (modified) (2 diffs)
-
src/Plugin.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
officegest/trunk/officegest.php
r2494247 r2510697 5 5 * Plugin URI: https://www.officegest.com/woocommerce 6 6 * Description: A forma mais fácil de ligar a sua loja online com a sua faturação. 7 * Version: 1.1. 27 * Version: 1.1.3 8 8 * Author: OfficeGest 9 9 * Author URI: https://www.officegest.com -
officegest/trunk/readme.txt
r2494247 r2510697 5 5 Tested up to: 5.5 6 6 Requires PHP: 7.3 7 Stable tag: 1.1. 27 Stable tag: 1.1.3 8 8 License: GPLv2 or later 9 9 License URI: https://www.gnu.org/licenses/gpl-2.0.html … … 33 33 34 34 == Changelog == 35 = 1.1.3 = 36 add cron to force clear parts 37 35 38 = 1.1.2 = 36 39 add option to sync only parts with images -
officegest/trunk/src/Crons.php
r2420184 r2510697 4 4 5 5 use Exception; 6 use OfficeGest\Controllers\SyncEcoautoForceClearParts; 6 7 use OfficeGest\Controllers\SyncEcoautoImages; 7 8 use OfficeGest\Controllers\SyncOfficeGestArticles; … … 231 232 OfficeGestDBModel::setOption("ecoauto_imagens_time", (int)$runningAt); 232 233 } 234 235 /** 236 * Force clear parts function (officegest_cron_jobs) 237 * 238 */ 239 public static function SyncEcoautoForceClearParts(){ 240 $runningAt = time(); 241 try { 242 self::requires(); 243 if (!Start::login()) { 244 Log::write("Não foi possível estabelecer uma ligação ao OfficeGest"); 245 return false; 246 } 247 $sync_time = OfficeGestDBModel::getOption('officegest_clear_parts_time'); 248 if ($sync_time==null) { 249 $sync_time = (int)(time() - 600); 250 OfficeGestDBModel::setOption('officegest_clear_parts_time',$sync_time); 251 } 252 (new SyncEcoautoForceClearParts())->run(); 253 } catch (Exception $ex) { 254 Log::write("Fatal Errror: " . $ex->getMessage()); 255 } 256 OfficeGestDBModel::setOption("officegest_clear_parts_time", (int)$runningAt); 257 } 233 258 } -
officegest/trunk/src/Plugin.php
r2494247 r2510697 5 5 use OfficeGest\Controllers\Documents; 6 6 use OfficeGest\Controllers\ProductsList; 7 use OfficeGest\Controllers\SyncEcoautoForceClearParts; 7 8 use WC_Countries; 8 9 use WC_Order; … … 89 90 if (!wp_next_scheduled('syncOfficeGestArticles')) { 90 91 wp_schedule_event(time(), 'daily', 'syncOfficeGestArticles'); 92 } 93 94 /** 95 * Schedule sync jobs in queue (officegest_cron_jobs) 96 */ 97 add_action('SyncEcoautoForceClearParts', '\OfficeGest\Crons::SyncEcoautoForceClearParts'); 98 if (!wp_next_scheduled('SyncEcoautoForceClearParts')) { 99 wp_schedule_event(time(), 'hourly', 'SyncEcoautoForceClearParts'); 91 100 } 92 101 }
Note: See TracChangeset
for help on using the changeset viewer.