Skip to content

Commit

Permalink
(#671) Update the filemap whenever an ID gets modified
Browse files Browse the repository at this point in the history
  • Loading branch information
Difegue committed Oct 14, 2022
1 parent 07afbb5 commit f80b3f6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions lib/LANraragi/Utils/Database.pm
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,7 @@ sub clean_database {
$redis->hset( $id, "file", "" );
} else {
change_archive_id( $id, $newid, $redis );
$redis->hset( "LRR_FILEMAP", $file, $newid );
}

} else {
Expand Down
2 changes: 2 additions & 0 deletions lib/Shinobu.pm
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,8 @@ sub add_to_filemap {

LANraragi::Utils::Database::change_archive_id( $filemap_id, $id, $redis );

# Don't forget to update the filemap, later operations will behave incorrectly otherwise
$redis->hset( "LRR_FILEMAP", $file, $id );
} else {
$logger->debug(
"$file has the same ID as the one in the filemap. Duplicate inotify events? Cleaning cache just to make sure");
Expand Down

0 comments on commit f80b3f6

Please sign in to comment.