Browse Source

Some changes after code review

pull/11877/head
Michael 1 month ago
parent
commit
cc43b567cb
  1. 2
      mod/tagger.php
  2. 2
      src/Core/Worker.php
  3. 8
      src/Model/Photo.php

2
mod/tagger.php

@ -51,7 +51,7 @@ function tagger_content(App $a) {
$item_id = ((DI::args()->getArgc() > 1) ? trim(DI::args()->getArgv()[1]) : 0);
Logger::info('tagger: tag ' . $term . ' item ' . $item_id);
Logger::info('tagger: tag', ['term' => $term, 'item' => $item_id]);
$item = Post::selectFirst([], ['id' => $item_id]);

2
src/Core/Worker.php

@ -104,7 +104,7 @@ class Worker
foreach ($r as $entry) {
// The work will be done
if (!self::execute($entry)) {
Logger::warning('Process execution failed, quitting.');
Logger::warning('Process execution failed, quitting.', ['entry' => $entry]);
return;
}

8
src/Model/Photo.php

@ -1095,7 +1095,7 @@ class Photo
$r = self::store($image, $user['uid'], 0, $resource_id, $filename, $album, 0, self::DEFAULT, $allow_cid, $allow_gid, $deny_cid, $deny_gid, $desc);
if (!$r) {
Logger::warning('Photo could not be stored');
Logger::warning('Photo could not be stored', ['uid' => $user['uid'], 'resource_id' => $resource_id, 'filename' => $filename, 'album' => $album]);
return [];
}
@ -1182,7 +1182,7 @@ class Photo
$r = self::store($image, $uid, 0, $resource_id, $filename, $album, 4, self::USER_AVATAR);
if (!$r) {
logger::warning('profile image upload with scale 4 (300) failed');
logger::warning('profile image upload with scale 4 (300) failed', ['uid' => $uid, 'resource_id' => $resource_id, 'filename' => $filename, 'album' => $album]);
}
if ($width > 80 || $height > 80) {
@ -1191,7 +1191,7 @@ class Photo
$r = self::store($image, $uid, 0, $resource_id, $filename, $album, 5, self::USER_AVATAR);
if (!$r) {
logger::warning('profile image upload with scale 5 (80) failed');
logger::warning('profile image upload with scale 5 (80) failed', ['uid' => $uid, 'resource_id' => $resource_id, 'filename' => $filename, 'album' => $album]);
}
if ($width > 48 || $height > 48) {
@ -1200,7 +1200,7 @@ class Photo
$r = self::store($image, $uid, 0, $resource_id, $filename, $album, 6, self::USER_AVATAR);
if (!$r) {
logger::warning('profile image upload with scale 6 (48) failed');
logger::warning('profile image upload with scale 6 (48) failed', ['uid' => $uid, 'resource_id' => $resource_id, 'filename' => $filename, 'album' => $album]);
}
logger::info('new profile image upload ended');

Loading…
Cancel
Save