Archived
1
0

ensure skiplist entry

This commit is contained in:
Jeff Becker 2018-05-06 12:35:03 -04:00
parent 7a7432f2b5
commit 6a69c81e79
No known key found for this signature in database
GPG Key ID: F357B3B42F6F9B05
2 changed files with 5 additions and 1 deletions

View File

@ -169,6 +169,7 @@ void NNTPServerHandler::ArticleObtained()
{ {
m_article->close(); m_article->close();
m_article = nullptr; m_article = nullptr;
m_store.EnsureSymlinks(m_articleName);
QueueLine("239 " + m_articleName); QueueLine("239 " + m_articleName);
std::cerr << "stored " << m_articleName << std::endl; std::cerr << "stored " << m_articleName << std::endl;
} }

View File

@ -80,7 +80,10 @@ bool ArticleStorage::LoadThread(Thread &thread, const std::string &rootmsgid) co
void ArticleStorage::EnsureSymlinks(const std::string &msgid) const void ArticleStorage::EnsureSymlinks(const std::string &msgid) const
{ {
std::string msgidhash = Blake2B_base32(msgid); std::string msgidhash = Blake2B_base32(msgid);
skiplist_dir(posts_skiplist_dir, msgidhash); auto skip = skiplist_dir(skiplist_root(posts_skiplist_dir), msgidhash) / msgidhash;
auto path = fs::path("..") / fs::path("..") / fs::path("..") / MessagePath(msgid);
fs::create_symlink(path, skip);
errno = 0;
} }
fs::path ArticleStorage::skiplist_root(const std::string &name) const { return basedir / name; } fs::path ArticleStorage::skiplist_root(const std::string &name) const { return basedir / name; }