Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
N
Nextcloud mail - PostGuard
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Laura Kolijn
Nextcloud mail - PostGuard
Commits
7ccc0861
Unverified
Commit
7ccc0861
authored
4 years ago
by
Christoph Wurst
Browse files
Options
Downloads
Patches
Plain Diff
Add console logging to the threading command
Signed-off-by:
Christoph Wurst
<
christoph@winzerhof-wurst.at
>
parent
73efd7da
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
lib/Command/Thread.php
+10
-2
10 additions, 2 deletions
lib/Command/Thread.php
with
10 additions
and
2 deletions
lib/Command/Thread.php
+
10
−
2
View file @
7ccc0861
...
...
@@ -25,6 +25,7 @@ namespace OCA\Mail\Command;
use
OCA\Mail\IMAP\Threading\DatabaseMessage
;
use
OCA\Mail\IMAP\Threading\ThreadBuilder
;
use
OCA\Mail\Support\ConsoleLoggerDecorator
;
use
Psr\Log\LoggerInterface
;
use
Symfony\Component\Console\Command\Command
;
use
Symfony\Component\Console\Input\InputArgument
;
...
...
@@ -62,6 +63,11 @@ class Thread extends Command {
}
protected
function
execute
(
InputInterface
$input
,
OutputInterface
$output
):
int
{
$consoleLogger
=
new
ConsoleLoggerDecorator
(
$this
->
logger
,
$output
);
$inputFile
=
$input
->
getArgument
(
self
::
ARGUMENT_INPUT_FILE
);
if
(
!
file_exists
(
$inputFile
))
{
...
...
@@ -74,7 +80,9 @@ class Thread extends Command {
$output
->
writeln
(
"<error>Could not read thread data</error>"
);
return
2
;
}
$parsed
=
json_decode
(
$json
,
true
);
$consoleLogger
->
debug
(
strlen
(
$json
)
.
'B read'
);
$parsed
=
json_decode
(
$json
,
true
,
512
,
JSON_THROW_ON_ERROR
);
$consoleLogger
->
debug
(
count
(
$parsed
)
.
' data sets loaded'
);
$threadData
=
array_map
(
function
(
$serialized
)
{
return
new
DatabaseMessage
(
$serialized
[
'databaseId'
],
...
...
@@ -85,7 +93,7 @@ class Thread extends Command {
);
},
$parsed
);
$threads
=
$this
->
builder
->
build
(
$threadData
,
$
this
->
l
ogger
);
$threads
=
$this
->
builder
->
build
(
$threadData
,
$
consoleL
ogger
);
$output
->
writeln
(
count
(
$threads
)
.
" threads built from "
.
count
(
$threadData
)
.
" messages"
);
$mbs
=
(
int
)(
memory_get_peak_usage
()
/
1024
/
1024
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment