Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wordpress service + event-emitters #487

Merged
merged 1 commit into from Nov 22, 2023

Conversation

fcaps
Copy link
Collaborator

@fcaps fcaps commented Nov 21, 2023

closes #454
related to #480

this.wordpressClient = wordpressClient
}
async fetchNews() {
let response = await this.wordpressClient.get('/wp-json/wp/v2/posts/?per_page=100&_embed&_fields=_links.author,_links.wp:featuredmedia,_embedded,title,content.rendered,date,categories&categories=587')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the categories url was configurable via env?
But I see so many categories now, I'm no longer sure.
Maybe we should at least put the ids as const variables at the top of the file for better naming in the actual urls?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

was just copy&pasta, https://github.com/FAForever/website/pull/487/files#diff-7e4783341040a4ba6619cd0157ccb8d361c450d4ac84148a2fe589414db924ddL22

maybe we can optimize it later? there are for sure other problems, like "options/fields" not used...

@@ -101,23 +101,7 @@ exports = module.exports = function (req, res) {
}

locals.reportable_members = {};
const recentMembersPath = 'members/recent.json';
if (fs.existsSync(recentMembersPath)){
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we got this covered in #233, when the m2m is ready

module.exports = async () => {
await warmupWordpressCache()

const wordpressScheduler = new Scheduler('createWordpressCaches', warmupWordpressCache, 60 * 59 * 1000)
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i'll make all the "magic" numbers into a config once it is somewhat stable and does not change so often.
don't wanna add env-vars directly

@@ -19,8 +19,6 @@ html(lang='en')

//- Customise the stylesheet for your site by editing /public/styles/site.sass
link(href="/styles/css/site.min.css?version="+Date.now(), rel="stylesheet")
script(async, defer, data-domain="faforever.com", src="https://plausible.faforever.com/js/plausible.js")
script(src="https://kit.fontawesome.com/33e7e258d3.js" crossorigin='anonymous')
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

plausible http 404
kit: http 403

don't know why this was loaded, but the newshub still looks okay

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Plausible is currently disabled on the server.

@Brutus5000 Brutus5000 merged commit ee1b835 into FAForever:develop Nov 22, 2023
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Replace setInterval
2 participants