Browse Source

Ensure that the spool path is set

pull/3173/head
Michael 4 years ago
parent
commit
9251d2af6f
2 changed files with 7 additions and 4 deletions
  1. +6
    -3
      include/items.php
  2. +1
    -1
      include/spool_post.php

+ 6
- 3
include/items.php View File

@ -860,9 +860,12 @@ function item_store($arr,$force_parent = false, $notify = false, $dontcache = fa
// We use "microtime" to keep the arrival order and "mt_rand" to avoid duplicates
$file = 'item-'.round(microtime(true) * 10000).'-'.mt_rand().'.msg';
$spool = get_spoolpath().'/'.$file;
file_put_contents($spool, json_encode($arr));
logger("Item wasn't stored - Item was spooled into file ".$file, LOGGER_DEBUG);
$spoolpath = get_spoolpath();
if ($spoolpath != "") {
$spool = $spoolpath.'/'.$file;
file_put_contents($spool, json_encode($arr));
logger("Item wasn't stored - Item was spooled into file ".$file, LOGGER_DEBUG);
}
return 0;
}


+ 1
- 1
include/spool_post.php View File

@ -27,7 +27,7 @@ function spool_post_run($argv, $argc) {
$path = get_spoolpath();
if (is_writable($path)){
if (($path != '') AND is_writable($path)){
if ($dh = opendir($path)) {
while (($file = readdir($dh)) !== false) {


Loading…
Cancel
Save