llamaenterhear
Username: Password:

Author Topic: Nightly Cronjob  (Read 2204 times)

0 Members and 1 Lonely Barbarian are spying on this topic.

Offline Strolen

  • Ignorance Incarnate
  • Guild Leader
  • Emperor
  • *
  • Posts: 7991
  • All your base are belong to us.
  • Awards Locations Guild Questor Locations Guild Elite Item Guild Hall of Heroes 10 Plot Guild
    • Strolen's Citadel
    • Awards
Nightly Cronjob
« on: May 06, 2012, 02:50:04 AM »
Since I am having to hyper analyze it for what is going on I figured I might as well tell you what it does. Italics is more for me so I can fix it.

1.  Collects all the authors that have visited the site in the last 24 hours.
-- I do this so I don't have to go through all 2000 members that haven't visited
-- I just have to do a quick switch to a double check on all if needed

2. For each author it does a raw count of the subs and re-updates the total
-- Looks like I commented out the contributors count to this so co-authors is currently not counted in author count

3. Gives bonus XP for each logged in author during the past day

4. Gives bonus XP for how many votes are cast between checks
-- Those that use at least 5 votes get a bonus
-- Those that use all their votes get an extra bonus on top of that

5. If anybody went into negative XP, update them to 0
-- for possible newbies that don't do so well

6. Level-up Check (this is where it has been crashing for some reason)
-- Grab all the level information
-- Compare each level to the authors XP and Submission count.
-- Log level and continue checking till it hits a level it doesn't count
-- -- Could probably save a couple loops by starting with author's current level
-- Compare this level with author's level to see if they leveled up

7. Update Announcements for frontpage
-- Prune old announcements
-- Update authors that leveled-up
-- Get a new random sub of the day
-- -- Must be over a year old

8. Update Award Badges from the forum
-- Does all the sub counts and sees if they match a badge and updates as required


Special Case only run when I want
1. Updates contributors table
-- Goes through all the subs, grabs contributors and updates contrib table

2. Clean user database
-- Checks for forum posts and Citadel Submissions
-- If none after a year, delete account

3. Update Authors Comment Count
« Last Edit: May 13, 2012, 12:42:56 PM by Strolen »

Flying Squirrel – Strolenati Guild
Grothar Rockfury - Dwarvish Guild
Minor Minion - Cartographer's Guild
Level 3
STR: 5 | END: 2 | CON: 3 | DEX: 2 | CHA: 2 | INT: 6
Authentic Strolenite™©® | Llama is as Llama does.


Offline Strolen

  • Ignorance Incarnate
  • Guild Leader
  • Emperor
  • *
  • Posts: 7991
  • All your base are belong to us.
  • Awards Locations Guild Questor Locations Guild Elite Item Guild Hall of Heroes 10 Plot Guild
    • Strolen's Citadel
    • Awards
Re: Nightly Cronjob
« Reply #1 on: May 13, 2012, 02:35:16 AM »
Updated it so that those that use at least 5 votes during the day get a bonus.

Flying Squirrel – Strolenati Guild
Grothar Rockfury - Dwarvish Guild
Minor Minion - Cartographer's Guild
Level 3
STR: 5 | END: 2 | CON: 3 | DEX: 2 | CHA: 2 | INT: 6
Authentic Strolenite™©® | Llama is as Llama does.


Offline Strolen

  • Ignorance Incarnate
  • Guild Leader
  • Emperor
  • *
  • Posts: 7991
  • All your base are belong to us.
  • Awards Locations Guild Questor Locations Guild Elite Item Guild Hall of Heroes 10 Plot Guild
    • Strolen's Citadel
    • Awards
Re: Nightly Cronjob
« Reply #2 on: May 13, 2012, 06:50:28 AM »
Updated to count all collaborative submissions as well. So submission count should be a true number now to include everything.

Flying Squirrel – Strolenati Guild
Grothar Rockfury - Dwarvish Guild
Minor Minion - Cartographer's Guild
Level 3
STR: 5 | END: 2 | CON: 3 | DEX: 2 | CHA: 2 | INT: 6
Authentic Strolenite™©® | Llama is as Llama does.


Offline Silveressa

  • Mourning Wolf
  • Squirrel Strolenati
  • Grand Master
  • *
  • Posts: 611
  • Scottish wolf-&^%$@ with silver fangs
  • Awards Guardian of the Citadel Elite NPC Guild Questor 2012 Location of the Year 2012 Sub of the Year Article Guild
    • Awards
Re: Nightly Cronjob
« Reply #3 on: May 13, 2012, 10:24:19 AM »
Updated to count all collaborative submissions as well. So submission count should be a true number now to include everything.

Thank you so very much for this, it;s nice to see those who work together on a sub get equal credit for their efforts  :up:
"Lesbian gamers, sometimes we use our hands for other things."

Offline MysticMoon

  • Mad Prophet
  • Strolenati
  • Grand Master
  • *
  • Posts: 721
  • Månlufsen (The Moon Bum)
  • Awards Golden Creator Questor Hall of Heroes 5 2011 Society of the Year
    • Awards
Re: Nightly Cronjob
« Reply #4 on: May 13, 2012, 01:34:27 PM »
Somehow it bumped me up to level 8. It says I have 35 submissions at the top of my profile, but lower down it only shows 18 (which is correct.) I have 4 co-authored so that should only bump me up to 22 / level 7.

I only have 1 public in work, 1 advice requested, and no private in work.
Chosen of Aktagarti – Divine Synod Guild – Level 1
Might: 2 | Agility: 3 | Wits: 4 | Charm: 3 | Spirit: 4 | Power: 2

The old man, grey-haired, braid hanging down.
He is clothed in faded brown robes.
His craggy face is turned up, bathed in moonlight;
He looks for his goddess to smile upon him.

Offline Strolen

  • Ignorance Incarnate
  • Guild Leader
  • Emperor
  • *
  • Posts: 7991
  • All your base are belong to us.
  • Awards Locations Guild Questor Locations Guild Elite Item Guild Hall of Heroes 10 Plot Guild
    • Strolen's Citadel
    • Awards
Re: Nightly Cronjob
« Reply #5 on: May 13, 2012, 01:46:45 PM »
On it!

Flying Squirrel – Strolenati Guild
Grothar Rockfury - Dwarvish Guild
Minor Minion - Cartographer's Guild
Level 3
STR: 5 | END: 2 | CON: 3 | DEX: 2 | CHA: 2 | INT: 6
Authentic Strolenite™©® | Llama is as Llama does.


Offline Strolen

  • Ignorance Incarnate
  • Guild Leader
  • Emperor
  • *
  • Posts: 7991
  • All your base are belong to us.
  • Awards Locations Guild Questor Locations Guild Elite Item Guild Hall of Heroes 10 Plot Guild
    • Strolen's Citadel
    • Awards
Re: Nightly Cronjob
« Reply #6 on: May 13, 2012, 02:08:00 PM »
Ahh, a few things going on with that. Thank you for another great catch!

Collab database had a bunch of duplicates. I think I ran a script a few times for troubleshooting and didn't catch that. Dumped it and restocked it so it is fresh and accurate. Should stay that way now but submissions may do some whacky stuff (have to delete and re-add collaborators on any edit because I don't know if you get help from somebody else and have to add another name to your sub). Will keep an eye on that as we go.

Additionally, I changed the author sub count to only count public submissions. It was counting them all which would effect other folks I am sure.

So, thanks to your help, we should be back to "accurate."

(+10XP for catching it!)

Flying Squirrel – Strolenati Guild
Grothar Rockfury - Dwarvish Guild
Minor Minion - Cartographer's Guild
Level 3
STR: 5 | END: 2 | CON: 3 | DEX: 2 | CHA: 2 | INT: 6
Authentic Strolenite™©® | Llama is as Llama does.


Offline MysticMoon

  • Mad Prophet
  • Strolenati
  • Grand Master
  • *
  • Posts: 721
  • Månlufsen (The Moon Bum)
  • Awards Golden Creator Questor Hall of Heroes 5 2011 Society of the Year
    • Awards
Re: Nightly Cronjob
« Reply #7 on: May 13, 2012, 08:54:57 PM »
Most excellent! All is well again. Especially now that those collabs have bumped me up to 7.  :up:
Chosen of Aktagarti – Divine Synod Guild – Level 1
Might: 2 | Agility: 3 | Wits: 4 | Charm: 3 | Spirit: 4 | Power: 2

The old man, grey-haired, braid hanging down.
He is clothed in faded brown robes.
His craggy face is turned up, bathed in moonlight;
He looks for his goddess to smile upon him.