Skip to content

Callforusersthatloggedin stable9.1#27248

Merged
PVince81 merged 5 commits into
stable9.1from
callforusersthatloggedin-stable9.1
Mar 1, 2017
Merged

Callforusersthatloggedin stable9.1#27248
PVince81 merged 5 commits into
stable9.1from
callforusersthatloggedin-stable9.1

Conversation

@jvillafanez

Copy link
Copy Markdown
Member

Description

Backport of #26361 with some adjusments

Related Issue

Motivation and Context

How Has This Been Tested?

Not yet tested.

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@PVince81 @DeepDiver1975

butonic and others added 2 commits February 24, 2017 13:19
* introduce callForSeenUsers and countSeenUsers

* add tests

* oracle should support not null on clob

* since 9.2.0

Conflicts:
	lib/private/Repair/MoveAvatarOutsideHome.php
	lib/private/User/Manager.php
	tests/lib/User/ManagerTest.php
@jvillafanez jvillafanez added this to the 9.1.5 milestone Feb 24, 2017
@mention-bot

Copy link
Copy Markdown

@jvillafanez, thanks for your PR! By analyzing the history of the files in this pull request, we identified @VicDeo, @PVince81 and @nickvergessen to be potential reviewers.

@jvillafanez

Copy link
Copy Markdown
Member Author

Trashbin:expire -> only deleted one file with just the admin account logged in, and 225 LDAP users available:

without patch:

root@99f35337e60d:/opt/owncloud# time sudo -u www-data ./occ trashbin:expire
  226 [============================]

real	0m4.399s
user	0m0.996s
sys	0m0.312s
root@99f35337e60d:/opt/owncloud# time sudo -u www-data ./occ trashbin:expire
  226 [============================]

real	0m3.670s
user	0m0.928s
sys	0m0.276s

with patch:

root@f7a40a896fc2:/opt/owncloud# time sudo -u www-data ./occ trashbin:expire
    1 [============================]

real	0m0.464s
user	0m0.248s
sys	0m0.172s
root@f7a40a896fc2:/opt/owncloud# time sudo -u www-data ./occ trashbin:expire
    1 [============================]

real	0m0.417s
user	0m0.252s
sys	0m0.140s

});
if (is_callable(array($this->userManager, 'callForSeenUsers'))) {
$this->userManager->callForSeenUsers(function(IUser $user) {
$uid = $user->getUID();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

put this in a separate inline function to avoid code duplication ?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the other alternative is to store the name of the method in a string:

    $methodName = 'callForSeenUsers';
    $this->userManager->$methodName(...);

$this->expireTrashForUser($user);
});
if (is_callable(array($this->userManager, 'callForSeenUsers'))) {
$this->userManager->callForSeenUsers(function(IUser $user) use ($p) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here

@jvillafanez

Copy link
Copy Markdown
Member Author

Version:expire (same as above)

without patch:

root@99f35337e60d:/opt/owncloud# time sudo -u www-data ./occ version:expire
  226 [============================]

real	0m3.834s
user	0m1.048s
sys	0m0.200s
root@99f35337e60d:/opt/owncloud# time sudo -u www-data ./occ version:expire
  226 [============================]

real	0m3.663s
user	0m0.984s
sys	0m0.264s

with patch:

root@f7a40a896fc2:/opt/owncloud# time sudo -u www-data ./occ version:expire
    1 [============================]

real	0m0.406s
user	0m0.252s
sys	0m0.132s
root@f7a40a896fc2:/opt/owncloud# time sudo -u www-data ./occ version:expire
    1 [============================]

real	0m0.419s
user	0m0.280s
sys	0m0.112s

@jvillafanez

Copy link
Copy Markdown
Member Author

Expire versions background job:

without patch (3 seconds):

{"reqId":"9pEyyV1uBAbknmInpMvZ","remoteAddr":"82.159.139.58","app":"cron","message":"Started background job of class : OCA\\Files_Versions\\BackgroundJob\\ExpireVersions with arguments : ","level":0,"time":"2017-02-27T12:23:13+00:00","method":"GET","url":"\/cron.php","user":"--"}
{"reqId":"9pEyyV1uBAbknmInpMvZ","remoteAddr":"82.159.139.58","app":"cron","message":"Finished background job, the job took : 3 seconds, this job is an instance of class : OCA\\Files_Versions\\BackgroundJob\\ExpireVersionswith arguments : ","level":0,"time":"2017-02-27T12:23:16+00:00","method":"GET","url":"\/cron.php","user":"--"}

with patch (0 seconds):

{"reqId":"q96oCxDGUM\/4un4H51hh","remoteAddr":"82.159.139.58","app":"cron","message":"Started background job of class : OCA\\Files_Versions\\BackgroundJob\\ExpireVersions with arguments : ","level":0,"time":"2017-02-27T12:25:07+00:00","method":"GET","url":"\/cron.php","user":"--"}
{"reqId":"q96oCxDGUM\/4un4H51hh","remoteAddr":"82.159.139.58","app":"cron","message":"Finished background job, the job took : 0 seconds, this job is an instance of class : OCA\\Files_Versions\\BackgroundJob\\ExpireVersionswith arguments : ","level":0,"time":"2017-02-27T12:25:07+00:00","method":"GET","url":"\/cron.php","user":"--"}

@jvillafanez

Copy link
Copy Markdown
Member Author

Expire trashbin background job:

without patch (3 seconds):

{"reqId":"TuTI+FdM81ex6PN7fq\/O","remoteAddr":"82.159.139.58","app":"cron","message":"Started background job of class : OCA\\Files_Trashbin\\BackgroundJob\\ExpireTrash with arguments : ","level":0,"time":"2017-02-27T12:59:30+00:00","method":"GET","url":"\/cron.php","user":"--"}
{"reqId":"TuTI+FdM81ex6PN7fq\/O","remoteAddr":"82.159.139.58","app":"cron","message":"Finished background job, the job took : 3 seconds, this job is an instance of class : OCA\\Files_Trashbin\\BackgroundJob\\ExpireTrashwith arguments : ","level":0,"time":"2017-02-27T12:59:33+00:00","method":"GET","url":"\/cron.php","user":"--"}

with patch (0 seconds):

{"reqId":"1dFvCu6ehXqCz+dEXT9b","remoteAddr":"82.159.139.58","app":"cron","message":"Started background job of class : OCA\\Files_Trashbin\\BackgroundJob\\ExpireTrash with arguments : ","level":0,"time":"2017-02-27T13:00:11+00:00","method":"GET","url":"\/cron.php","user":"--"}
{"reqId":"1dFvCu6ehXqCz+dEXT9b","remoteAddr":"82.159.139.58","app":"cron","message":"Finished background job, the job took : 0 seconds, this job is an instance of class : OCA\\Files_Trashbin\\BackgroundJob\\ExpireTrashwith arguments : ","level":0,"time":"2017-02-27T13:00:11+00:00","method":"GET","url":"\/cron.php","user":"--"}

@jvillafanez

Copy link
Copy Markdown
Member Author

I think this is ready.

@PVince81 PVince81 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Almost there, adjust @since

/**
* returns how many users have logged in once
*
* @return int

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@since 9.1 here and below

@PVince81

PVince81 commented Mar 1, 2017

Copy link
Copy Markdown
Contributor

👍

Jenkins tests passed but unpublished

@PVince81 PVince81 merged commit 59bd7f4 into stable9.1 Mar 1, 2017
@PVince81 PVince81 deleted the callforusersthatloggedin-stable9.1 branch March 1, 2017 17:14
@lock

lock Bot commented Aug 3, 2019

Copy link
Copy Markdown

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock Bot locked as resolved and limited conversation to collaborators Aug 3, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants