Skip to content

Commit

Permalink
feat: post push order.
Browse files Browse the repository at this point in the history
  • Loading branch information
sdttttt committed Apr 17, 2023
1 parent 907402b commit 9b51cd0
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/push.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ pub async fn push_update(db: Arc<Database>, feed: SubscribeFeed) -> Result<(), a
let old_feed = db.update_or_create_feed(&new_feed)?.unwrap(); // 更新

// 取出新的文章index
let ref new_indexs = new_feed.diff_post_index(&old_feed);
let ref mut new_indexs = new_feed.diff_post_index(&old_feed);
if new_indexs.is_empty() {
info!("订阅源无更新: {}", &*new_feed.subscribe_url);
return Ok(());
Expand All @@ -58,7 +58,10 @@ pub async fn push_update(db: Arc<Database>, feed: SubscribeFeed) -> Result<(), a
let chans = db.feed_channel_list(&*new_feed.subscribe_url)?;
for ch in chans {
let regex_str_op = ch.feed_regex.get(&utils::hash(&old_feed.subscribe_url));
for idx in new_indexs {

// 倒序一下,让新文章排在后面
new_indexs.reverse();
for idx in &*new_indexs {
let post = &new_rss.posts[*idx];

// 是否需要过滤
Expand Down

0 comments on commit 9b51cd0

Please sign in to comment.