Skip to content
Snippets Groups Projects
  • Roeland Jago Douma's avatar
    8ca2b318
    Do not keep searching for recent · 8ca2b318
    Roeland Jago Douma authored
    
    If userA has a lot of recent files. But only shares 1 file with userB
    (that has no files at all). We could keep searching until we run out of
    recent files for userA.
    
    Now assume the inactive userB has 20 incomming shares like that from
    different users. getRecent then basically keeps consuming huge amounts
    of resources and with each iteration the load on the DB increases
    (because of the offset).
    
    This makes sure we do not get more than 3 times the limit we search for
    or more than 5 queries.
    
    This means we might miss some recent entries but we should fix that
    separatly. This is just to make sure the load on the DB stays sane.
    
    Signed-off-by: default avatarRoeland Jago Douma <roeland@famdouma.nl>
    8ca2b318
    History
    Do not keep searching for recent
    Roeland Jago Douma authored
    
    If userA has a lot of recent files. But only shares 1 file with userB
    (that has no files at all). We could keep searching until we run out of
    recent files for userA.
    
    Now assume the inactive userB has 20 incomming shares like that from
    different users. getRecent then basically keeps consuming huge amounts
    of resources and with each iteration the load on the DB increases
    (because of the offset).
    
    This makes sure we do not get more than 3 times the limit we search for
    or more than 5 queries.
    
    This means we might miss some recent entries but we should fix that
    separatly. This is just to make sure the load on the DB stays sane.
    
    Signed-off-by: default avatarRoeland Jago Douma <roeland@famdouma.nl>