File tree Expand file tree Collapse file tree 2 files changed +11
-2
lines changed Expand file tree Collapse file tree 2 files changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -62,7 +62,12 @@ async function processDocs(driver, project) {
62
62
63
63
await driver . write (
64
64
'versions' ,
65
- [ { id : project , name : project , versions } ] ,
65
+ [ {
66
+ id : project ,
67
+ name : project ,
68
+ index_date_timestamp : Date . now ( ) ,
69
+ versions
70
+ } ] ,
66
71
project
67
72
)
68
73
} catch ( err ) {
Original file line number Diff line number Diff line change @@ -56,7 +56,11 @@ async function getPreviouslyIndexedVersions(projectName) {
56
56
return [ ]
57
57
}
58
58
59
- let hit = hits . find ( hit => hit . name === projectName )
59
+ let hit = hits . filter ( hit => ( hit . name === projectName ) && hit . index_date_timestamp )
60
+ . sort ( function ( a , b ) {
61
+ return a . index_date_timestamp - b . index_date_timestamp ;
62
+ } )
63
+ . pop ( )
60
64
61
65
if ( ! hit ) {
62
66
return [ ]
You can’t perform that action at this time.
0 commit comments