# Problem with inactive user cleanup job

**URL:** https://meta.discourse.org/t/problem-with-inactive-user-cleanup-job/156665
**Category:** Support
**Created:** [July 3, 2020, 5:17am UTC](https://meta.discourse.org/t/problem-with-inactive-user-cleanup-job/156665 "2020-07-03T05:17:26Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![hosna](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/hosna/32/99969_2.png) [@hosna](https://meta.discourse.org/u/hosna)
#### Post date: [July 3, 2020, 5:17am UTC](https://meta.discourse.org/t/problem-with-inactive-user-cleanup-job/156665/1 "2020-07-03T05:17:26Z")

</div>

I realized that many of my inactive users has not been cleaned yet. So I checked those users and the code.  
Those users dont have any time for last\_seen\_at. So I think in the following line:

> <https://github.com/discourse/discourse/blob/main/app/jobs/scheduled/clean_up_inactive_users.rb#L14>

they are not detected and cleaned. Am I right? And what can I do?

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [July 3, 2020, 2:30pm UTC](https://meta.discourse.org/t/problem-with-inactive-user-cleanup-job/156665/2 "2020-07-03T14:30:52Z")

</div>

How did those users get created?

---

<div class="post-metadata">

### Author: ![hosna](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/hosna/32/99969_2.png) [@hosna](https://meta.discourse.org/u/hosna)
#### Post date: [July 3, 2020, 2:36pm UTC](https://meta.discourse.org/t/problem-with-inactive-user-cleanup-job/156665/3 "2020-07-03T14:36:01Z")

</div>

I think they are created via api and never actually see the forum.

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [July 6, 2020, 8:09am UTC](https://meta.discourse.org/t/problem-with-inactive-user-cleanup-job/156665/4 "2020-07-06T08:09:47Z")

</div>

Yes this job is certainly not going to touch these outlier records, I guess maybe update them to have last\_seen\_at

---

<div class="post-metadata">

### Author: ![hosna](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/hosna/32/99969_2.png) [@hosna](https://meta.discourse.org/u/hosna)
#### Post date: [July 7, 2020, 11:39am UTC](https://meta.discourse.org/t/problem-with-inactive-user-cleanup-job/156665/5 "2020-07-07T11:39:18Z")

</div>

Is there a console command to add a default last\_seen\_at value?
