Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

11
LINES

< > BotCompany Repo | #1034444 // deleteOldConcepts

JavaX fragment (include) [tags: use-pretranspiled]

Libraryless. Click here for Pure Java version (20247L/122K).

1  
static <A extends Concept> L<A> deleteOldConcepts(Concepts cc default db_mainConcepts(),
2  
  Class<A> conceptClass, double minAgeInSeconds) {
3  
  new L<A> deleted;
4  
  for (A c : cloneList(list(cc, conceptClass)))
5  
    if (max(c._modified, c.created) < now()-toMS(minAgeInSeconds)) {
6  
      print("Deleting concept " + c);
7  
      deleted.add(c);
8  
      cdelete(c);
9  
    }
10  
  ret deleted;
11  
}

download  show line numbers  debug dex  old transpilations   

Travelled to 4 computer(s): bhatertpkbcr, ekrmjmnbrukm, mowyntqkapby, mqqgnosmbjvj

No comments. add comment

Snippet ID: #1034444
Snippet name: deleteOldConcepts
Eternal ID of this version: #1034444/3
Text MD5: 4ae443cf7b004f62ed9c7cfc769a6129
Transpilation MD5: 174243197e2830368fbc7aaf9c111652
Author: stefan
Category: javax / concepts
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2022-02-07 22:10:01
Source code size: 387 bytes / 11 lines
Pitched / IR pitched: No / No
Views / Downloads: 145 / 226
Version history: 2 change(s)
Referenced in: [show references]