File tree 1 file changed +30
-0
lines changed
1 file changed +30
-0
lines changed Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ require dirname (__FILE__ ) . '/app/bootstrap.php ' ;
4
+ $ bootstrap = \Magento \Framework \App \Bootstrap::create (BP , $ _SERVER );
5
+
6
+ class Outslide extends \Magento \Framework \App \Http
7
+ implements \Magento \Framework \AppInterface {
8
+ public function launch ()
9
+ {
10
+ $ appState = $ this ->_objectManager ->get ('Magento\Framework\App\State ' );
11
+ $ appState ->setAreaCode ('adminhtml ' );
12
+ $ resource = $ this ->_objectManager ->get ('Magento\Framework\App\ResourceConnection ' );
13
+ $ connection = $ resource ->getConnection ();
14
+ $ tableName = $ resource ->getTableName ('cron_schedule ' );
15
+
16
+ $ sql = "DELETE FROM " . $ tableName . " WHERE created_at < DATE_SUB(NOW(), INTERVAL 1 DAY) " ;
17
+
18
+ try {
19
+ $ result = $ connection ->query ($ sql );
20
+ }catch (Exception $ ex ){
21
+ print_r ($ ex );
22
+ }
23
+
24
+ return $ this ->_response ;
25
+ }
26
+ }
27
+
28
+ /** @var \Magento\Framework\App\Http $app */
29
+ $ app = $ bootstrap ->createApplication ('Outslide ' );
30
+ $ bootstrap ->run ($ app );
You can’t perform that action at this time.
0 commit comments